Django调试工具栏仅适用于管理员部分 [英] Django Debug Toolbar Only Working for Admin Section

查看:223
本文介绍了Django调试工具栏仅适用于管理员部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,
我一直在使用Django 1.2.1一段时间,并在另一天遇到了Django Debug Toolbar。看起来真的很有用,我真的很想尝试一些东西。



我正好安装了readme说的内容。一步步。我把中间件放在最后,以防万一发生事情,但我使用的是相当标准的中间件(常见的会话,auth和csrf)。但是,它不会显示在我的任何页面上。我已经尝试移动中间件,但效果相同。



似乎我已经安​​装了错误。但是,当我加载django的管理部分时,工具栏弹起。我不知道我做错了什么我的网页的内容能否影响到工具栏的出现?它在mime text / html ...中输出...



无论如何,任何帮助都不胜感激。感谢提前。



这是我的Settings.py:pastebin.com/Hu8TgANt

解决方案

调试工具栏需要响应HTML中至少有一个关闭< / body>标记。



可以通过更改 settings.DEBUG_TOOLBAR_​​CONFIG ['INSERT_BEFORE']



http://django-debug-toolbar.readthedocs.org/en/latest/configuration.html#toolbar-options


Hey, I've been using Django 1.2.1 for some time now and came across Django Debug Toolbar just the other day. It looks really useful and I'm really eager to try some stuff out.

I installed exactly how the readme said. Step by Step. I put the middleware at the end just in case things get caught up but I'm using quite standard middleware (common, sessions, auth and csrf). However, it won't show up on any of my pages. I've tried moving the middleware but to the same effect.

It seems as if I've installed something wrong. But, when I load up the Admin Section of django, the toolbar springs up. I'm not sure what I'm doing wrong. Can the content of my pages effect the toolbar coming up? It's outputting in the mime text/html...

Anyway, any help is greatly appreciated. Thanks in advance.

Here's my Settings.py: pastebin.com/Hu8TgANt

解决方案

Debug toolbar requires that there's at least a closing </body> tag in the response HTML.

This tag can be changed by changing settings.DEBUG_TOOLBAR_CONFIG['INSERT_BEFORE']

http://django-debug-toolbar.readthedocs.org/en/latest/configuration.html#toolbar-options

这篇关于Django调试工具栏仅适用于管理员部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆