django-extra-settings
django-extra-settings copied to clipboard
Warning from Django 5.0
Python version 3.11
Django version 5.0
Package version 0.11.0
Current behavior (bug description) After upgrading Django to 5.0 I got following warning:
$ python.exe manage.py runserver 127.0.0.1:8000
<...>\django\db\backends\utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported.
warnings.warn(self.APPS_NOT_READY_WARNING_MSG, category=RuntimeWarning)
This warning occurs from EXTRA_SETTINGS_DEFAULTS in settings.py:
EXTRA_SETTINGS_DEFAULTS = [
{
"name": "MARGIN",
"type": 'int',
"value": "7",
},
<...>
]
If I just comment it, warning dissapear.
It is a new behavior in Django 5.0. More information can be found here, for example.
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
@swasher thanks for reporting it!
@swasher could you please try to upgrade to 0.12.0 version and let me know?
@fabiocaccamo Thank you, now runs without warnings!