I am using django-environ in my project alongside with postgresql. I have been searching through the docs and found the format for DATABASE_URL to be like this:
DATABASE_URL=psql://user:password:port@database_url/db_name
However, by doing so the output of env.db('DATABASE_URL') is
{'PASSWORD': '', 'HOST': 'user', 'PORT': password, 'NAME': '', 'USER': '', 'ENGINE': 'django.db.backends.postgresql'}
What am I doing wrong here?
You have port in the wrong place in your URL. It's supposed to come after after the hostname:
DATABASE_URL=psql://user:password@host:port/database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With