Django Debug Toolbar Only Working for Admin Sectio

2019-02-12 23:12发布

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

7条回答
冷血范
2楼-- · 2019-02-13 00:08

A few tipps without knowing your code:

  • 'debug_toolbar.middleware.DebugToolbarMiddleware' should be your last or second to last middle ware entry (not 100% sure how it works out with the flatpagefallback middleware)
  • 'debug-toolbar' as last in the list of INSTALLED_APPS
  • Double check if the toolbar's assets are loaded
  • Make sure all toolbar settings are set. (DEBUG_TOOLBAR_CONFIG, INTERNAL_IPS) etc.

The error should be something in there. I know of other problems related getting the toolbar displayed on flatpages so if you only checked on flatpages I suggest you try it on another module.

查看更多
登录 后发表回答