python – django-debug-toolbar出现,但是为空(面板没有填充)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了python – django-debug-toolbar出现,但是为空(面板没有填充),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2375字,纯文字阅读大概需要4分钟。
内容图文
![python – django-debug-toolbar出现,但是为空(面板没有填充)](/upload/InfoBanner/zyjiaocheng/778/241bc87cc40147b5b87073245f325437.jpg)
几乎所有的时候,当我加载我的网站时,调试工具栏是空的,如下所示:
我在我的项目settings.py中进行了以下配置
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.webdesign',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'django.contrib.humanize',
'django.contrib.staticfiles',
'watrbuzz',
'watrworld',
'accounts',
'whregistration',
'whprofiles',
'analytical',
'watrdata',
'watrplace',
'analytical',
'debug_toolbar',
'debug_toolbar_mongo',
)
INTERNAL_IPS = (
'127.0.0.1',
'XX.XX.XXX.XXX',
)
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.sql.SQLDebugPanel',
'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.cache.CacheDebugPanel',
'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
#'debug_toolbar.panels.redirects.InterceptRedirectsPanel',
'debug_toolbar_mongo.panel.MongoDebugPanel',
)
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
#'SHOW_TOOLBAR_CALLBACK': show_toolbar,
# 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
#'HIDE_DJANGO_SQL': False,
'TAG': 'div',
'DEBUG_TOOLBAR_MEDIA_ROOT' : ' /usr/lib/python2.7/site-packages/debug_toolbar/',
'RENDER_PANELS' : True
}
如果我强制我的webapp显示回溯,我确实看到了面板填充.页面采用HTML格式,并且具有必要的< html>< / html> <身体GT;< /体>标签.
解决方法:
看起来你包含中间件太晚了,试着将DebugToolbarMiddleware放在MIDDLEWARE_CLASSES元组的开头.
看到:
http://django-debug-toolbar.readthedocs.org/en/latest/installation.html#middleware
您还需要查看javascript长度错误,是否可以检测到该错误的来源?
内容总结
以上是互联网集市为您收集整理的python – django-debug-toolbar出现,但是为空(面板没有填充)全部内容,希望文章能够帮你解决python – django-debug-toolbar出现,但是为空(面板没有填充)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。