question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DATABASES setting for Django not being set

See original GitHub issue

dynaconf is properly showing the settings I put into /etc/pulp/settings.py

(pulp) [vagrant@pulp3 pulp]$ dynaconf list -k DATABASES
Django app detected
Working in development environment 
DATABASES: {'default': {'CONN_MAX_AGE': 0,
             'ENGINE': 'django.db.backends.dummy',
             'HOST': 'postgres',
             'NAME': 'pulp',
             'PORT': '5432',
             'USER': 'pulp'}}

However, django is not using the setting. It seems like Django is loading the settings for the database before dynaconf is loaded.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
apollo13commented, Dec 29, 2018

@rochacbruno Against what? My changes just use dynaconf directly and drop the Django integration. There is not really anything to patch with that regard in dynaconf itself…

1reaction
dmsimardcommented, Dec 21, 2018

Hi o/

By the way, I think @apollo13 had a good idea by getting dynaconf to load settings from within settings instead of patching entrypoints for this issue.

You can see the commit here: https://github.com/openstack/ara-server/commit/fdcc003fd9c9c05f1e0fcbaa502939f592503e79

Read more comments on GitHub >

github_iconTop Results From Across the Web

DATABASES setting for Django not being set #89 - GitHub
The case is that Django is creating the database connection before it loads the INSTALLED_APPS where dynaconf is supposed to be loaded. Django...
Read more >
Django settings.DATABASE 'default' value is not set
I have the 'mioa' entry in there to demonstrate my problem. For some reason, the 'default' field is not getting set. Does anyone...
Read more >
Settings - Django documentation
You can use a database backend that doesn't ship with Django by setting ENGINE to a fully-qualified path (i.e. mypackage.backends.whatever ).
Read more >
Databases | Django documentation
When Django establishes a connection to the database, it sets up appropriate parameters, depending on the backend being used. If you enable persistent ......
Read more >
Multiple databases | Django documentation
This is done using the DATABASES setting. This setting maps database aliases, which are a way to refer to a specific database throughout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found