You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have a Django project in which I import the PANELS_DEFAULTS into the settings, modify it, and use it for DEBUG_TOOLBAR_PANELS. This simplifies the removal of any particular panel, as the defaults don't need to be hard-coded in our settings.
However, as of djdt 3.2.3, this no longer works. The following line in our settings.py file causes an AppRegistryNotReady error:
fromdebug_toolbar.settingsimportPANELS_DEFAULTS
If we change it to import debug_toolbar, I see an ImproperlyConfigured error related to missing SECRET_KEY.
I think this is because as of 3.2.3, debug_toolbar/__init__.py imports app_name, which ultimately imports the whole package. And perhaps that's not good to do that in a settings.py file. It might be that we can restructure our settings.py to make this work, but at the moment I'm guessing not.
Would it be possible to restructure things such that debug_toolbar.settings could be imported without triggering the import of other submodules? Perhaps put app_name by itself in a module that itself doesn't import anything? I'm happy to task a stab at this if someone indicates that it would be acceptable.
Or perhaps is there a different approach to "modifying" the default panel settings?
The text was updated successfully, but these errors were encountered:
Hello! I have a Django project in which I import the
PANELS_DEFAULTS
into the settings, modify it, and use it forDEBUG_TOOLBAR_PANELS
. This simplifies the removal of any particular panel, as the defaults don't need to be hard-coded in our settings.However, as of djdt 3.2.3, this no longer works. The following line in our
settings.py
file causes anAppRegistryNotReady
error:If we change it to
import debug_toolbar
, I see anImproperlyConfigured
error related to missingSECRET_KEY
.I think this is because as of 3.2.3,
debug_toolbar/__init__.py
importsapp_name
, which ultimately imports the whole package. And perhaps that's not good to do that in asettings.py
file. It might be that we can restructure oursettings.py
to make this work, but at the moment I'm guessing not.Would it be possible to restructure things such that
debug_toolbar.settings
could be imported without triggering the import of other submodules? Perhaps putapp_name
by itself in a module that itself doesn't import anything? I'm happy to task a stab at this if someone indicates that it would be acceptable.Or perhaps is there a different approach to "modifying" the default panel settings?
The text was updated successfully, but these errors were encountered: