jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.49k stars 205 forks source link

Database URL not updating database connection even when URL in settings is changed #94

Closed JadSayegh closed 6 years ago

JadSayegh commented 7 years ago

When trying to switch URLs on the same host e.g. postgresql://user:secret@localhost/my_db_1 to postgresql://user:secret@localhost/my_db_2, Django wasn't reflecting the change when I did this and kept connecting to my_db_1

$ python manage.py shell

>> from django import db
>> db.connection.settings_dict['NAME']
"my_db_1"

I changed back to using the normal Django database settings dict (instead of a URL with dj-database-url) and it worked. What could be causing this?

sigmavirus24 commented 6 years ago

We'd need significantly more detail before we'd be able to help you. Including, but not limited to:

JadSayegh commented 6 years ago

Hi Sigma, this was so long ago.. I would have to try to recreate the issue.

sigmavirus24 commented 6 years ago

It sounds like you're no longer encountering this. With that in mind, I'm going to close this until we know more.