1

尝试启用 django-debug-tool-bar 时出现“500 内部服务器错误”。它已经安装,我已将其粘贴到 settings.py 中:

if DEBUG:
    INTERNAL_IPS = ('127.0.0.1',)
    MIDDLEWARE_CLASSES += (
        'debug_toolbar.middleware.DebugToolbarMiddleware',
    )

    INSTALLED_APPS += (
    'debug_toolbar',
    )

    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.profiling.ProfilingDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.cache.CacheDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
    )

    DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
    }

我的 apache 不想正确加载中间件:apache 错误日志:

Traceback (most recent call last):
   File "/usr/local/lib/python3.3/dist-packages/django/core/handlers/wsgi.py", line 236, in __call__
     self.load_middleware()
   File "/usr/local/lib/python3.3/dist-packages/django/core/handlers/base.py", line 53, in load_middleware
     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
django.core.exceptions.ImproperlyConfigured: Error importing middleware debug_toolbar.middleware: "No module named 'thread'"

我试图在列表顶部添加调试工具栏中间件,但没有任何改变。我正在使用 django 1.5 和 python 3.3,并且我已经安装了调试工具栏,python3.3 setup.py install 但我没有看到什么?

4

0 回答 0