Нет модуля с именем settings_vars error в панели инструментов отладки django

Я пытаюсь использовать django-degub-toolbar в своем приложении django, а ниже - мои настройки

DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
)

MIDDLEWARE_CLASSES += [
'debug_toolbar.middleware.DebugToolbarMiddleware',
]

INSTALLED_APPS += [
 'debug_toolbar',
]

И когда я попытался запустить сервер, я становлюсь ниже ошибки

Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x32c8f10>>
Traceback (most recent call last):
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run
    self.validate(display_num_errors=True)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/core/management/base.py", line 280, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 166, in get_app_errors
    self._populate()
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 72, in _populate
    self.load_app(app_name, True)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 96, in load_app
    models = import_module('.models', app_name)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/user/.virtualenvs/proj/src/django-messages/django_messages/models.py", line 8, in <module>
    User = get_user_model()
  File "/home/user/.virtualenvs/proj/src/django-messages/django_messages/utils.py", line 93, in get_user_model
    return get_user_model()
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 125, in get_user_model
    user_model = get_model(app_label, model_name)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 230, in get_model
    self._populate()
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 72, in _populate
    self.load_app(app_name, True)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/db/models/loading.py", line 96, in load_app
    models = import_module('.models', app_name)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/debug_toolbar/models.py", line 10, in <module>
    from debug_toolbar.middleware import DebugToolbarMiddleware
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/debug_toolbar/middleware.py", line 13, in <module>
    from debug_toolbar.toolbar import DebugToolbar
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/debug_toolbar/toolbar.py", line 153, in <module>
    urlpatterns = DebugToolbar.get_urls()
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/debug_toolbar/toolbar.py", line 147, in get_urls
    for panel_class in cls.get_panel_classes():
  File "/home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/debug_toolbar/toolbar.py", line 125, in get_panel_classes
    (panel_module, e))
django.core.exceptions.ImproperlyConfigured: Error importing debug panel debug_toolbar.panels.settings_vars: "No module named settings_vars"

Как решить и почему возникла вышеуказанная ошибка?

+15
источник поделиться
1 ответ

Панель settings_var не найдена. Кажется, вы используете более старую версию конфигурации. Панели были недавно переименованы, новая конфигурация для версии 1.0:

DEBUG_TOOLBAR_PANELS = [
    'debug_toolbar.panels.versions.VersionsPanel',
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.settings.SettingsPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    'debug_toolbar.panels.request.RequestPanel',
    'debug_toolbar.panels.sql.SQLPanel',
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
    'debug_toolbar.panels.templates.TemplatesPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
]
+20
источник

Посмотрите другие вопросы по меткам или Задайте вопрос