gpt4 book ai didi

python - django 调试工具栏抛出配置不当的异常

转载 作者:太空宇宙 更新时间:2023-11-03 15:02:19 25 4
gpt4 key购买 nike

我安装了 django 1.9 和 django-debug-toolbar==1.3.0。这是我的settings.py内容

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

INSTALLED_APPS += (
'debug_toolbar',
)

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',
]

DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}

我已验证 DEBUG 设置为 True。运行服务器时,出现以下错误 -

django.core.exceptions.ImproperlyConfigured: Error importing debug panel debug_toolbar.panels.versions: "cannot import name linebreak_iter"

完整的堆栈跟踪可以在这里找到 - https://gist.github.com/anonymous/7a48e7c24d530118e5dfc0a75b982be2

出了什么问题? TIA。

最佳答案

调试工具栏 1.3 不支持 Django 1.9。您应该升级到 version 1.4哪个。

关于python - django 调试工具栏抛出配置不当的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36544004/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com