django-extra-settings icon indicating copy to clipboard operation
django-extra-settings copied to clipboard

Warning from Django 5.0

Open swasher opened this issue 1 year ago • 1 comments

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.
Fund with Polar

swasher avatar Dec 29 '23 12:12 swasher

@swasher thanks for reporting it!

fabiocaccamo avatar Dec 29 '23 13:12 fabiocaccamo

@swasher could you please try to upgrade to 0.12.0 version and let me know?

fabiocaccamo avatar Feb 27 '24 11:02 fabiocaccamo

@fabiocaccamo Thank you, now runs without warnings!

swasher avatar Feb 27 '24 11:02 swasher