Reputation: 267
I think I have tried almost every solution on the web but the django debug toolbar still doesn't appear on my website. Difficult thing is that it doesn't give any error, or any sign from where I can find the issue.
I have tried automatic as well as manual installation. Following most common things tried:
added my ip to internal ips, even added SHOW_TOOLBAR_CALLBACK = lambda x: True
Ran the collectstatic
command
checked for any html tags not closing in my pages
Confirmed that debug=True
in settings.py
5) removed .pyc files
And so on..
EDIT TO INCLUDE SETTINGS
Settings.py:
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',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
DEBUG_TOOLBAR_PATCH_SETTINGS = False
SHOW_TOOLBAR_CALLBACK = lambda x: True
INTERNAL_IPS = ('bla','bla',)
myproject/myproject/urls.py:
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns('',
url(r'^__debug__/', include(debug_toolbar.urls)),
)
Upvotes: 1
Views: 1653
Reputation: 1255
According to the docs of SHOW_TOOLBAR_CALLBACK
, it's value is not expected to be a function object:
This is the dotted path to a function used for determining whether the toolbar should show or not.
I.e. try using a normal named function, and reference it with a string in your settings.
Example, in your_project/config.py
def show_always(request):
return True
And then in settings:
SHOW_TOOLBAR_CALLBACK = 'your_project.config.show_always'
(Also, automatic setup did not work for me on one of two systems either, inexplicably; I had to use explicit setup, but you're doing that already.)
Upvotes: 1