How to Connect a PostgreSQL AWS RDS Database to a Django Project for Production

In this article, we show how to connect a postgresql AWS RDS database to a Django project for production.
A postgreSQL AWS RDS database is a popular choice when choosing a database for a website project.
This can be you directly working with AWS from an AWS account or using another service such as Heroku that uses AWS RDS service.
We want to see how we can connect our django project to a PostgreSQL AWS RDS database in a production environment.
The first thing we have to do is download a number of packages, which are required for our project.
These can be downloaded using the following lines below.
Then you just need to make sure you have an updated requirements.txt file.
This you can get using the following line below.
Once we have these in place, then we need to place the necessary code in the settings.py file within our project.
So you need to acccess key id, along with the aws secret access key.
You then need the aws storage bucket name.
The next very important variable is, DATABASES. This variable defines the AWS RDS database.
You must specify the username, password, aws RDS URL, and the database name.
This establishes connection with the AWS RDS database.
Now your postgreSQL AWS RDS database is connected to your django project for a production environment.
Related Resources
How to Create Your Own PostgreSQL Server on Your Own Computer in Windows