Issue
i develop an app on heroku server when i finished creating AWS RDS POSTGRESQL and run my migrations its throw me an error.
the error
settings.DATABASES is improperly configured. Please supply the NAME or OPTIONS['service']
value.
i do not run heroku run python manage.py migrate which i think is not the problem. I'm using heroku server and i setup everything its needs for aws rds for postgresql. i get this error in production server not on localhost, because its working perfect on localhost.
Database configurations in settings.py file
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '5432',
}
}
the error when running heroku run python manage.py makemigrations
File "/app/.heroku/python/lib/python3.10/site-
packages/django/db/backends/postgresql/base.py", line 159, in
get_connection_params
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
improperly configured. Please supply the NAME or OPTIONS['service']
value.
Solution
The problem comes from Heroku so I have solve my problem in settings under DATABASE_URL.
I added this for the first time.
postgresql://username:password@awsrdshost
Instead of this:
postgresql://username:password@awsrdshost:5432/dbname
Answered By - Adamu Abdulkarim
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.