Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

First time using AWS services with Django.

Was wondering how to configure the Django app running in an EC2 instance to a Postgres database in RDS?

the EC2 is running ubuntu

Any special configuration required?

1 Answer

0 votes
by (44.4k points)

Before starting off with the normal migration part provided in this official documentation, make sure that your RDS instance is available and accessible from your EC2 instance.

The modify settings.py file in the DATABASES section like this:

DATABASES = {

'default': {

    'ENGINE': 'django.db.backends.postgresql',

    'NAME': '<name defined upon RDS creation>',

    'USER': '<username defined upon RDS creation>',

    'PASSWORD': '<password defined upon RDS creation>',

    'HOST': '<this can be found in "Endpoint" on your RDS dashboard, exclude the ":" and the port number>',

    'PORT': '5432',

    }

}

Then, continue to migrate as suggested by the documentation.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...