Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django debug toolbar setup

I have just installed the Django debug toolbar. It was slightly fiddly and although it is working I wanted to check if this is the correct way. Here are the 4 steps that I need to achieve success:

  1. easy_install django_debug_toolbar
  2. add 'debug_toolbar.middleware.DebugToolbarMiddleware', to the end of my middleware classes in my project settings
  3. edit INTERNAL_IPS = ('127.0.0.1') in my django.global_settings.py
  4. then I added "/usr/local/lib/python2.7/dist-packages/django_debug_toolbar-0.8.5-py2.7.egg/debug_toolbar/templates" to my TEMPLATE_DIRS in project settings.

This was largely trial and error so I'm not sure this is the way to go. I am oarticoluarly unsure if step 4 is necessary...

Any input would be much appreciated

like image 711
Darwin Tech Avatar asked Oct 17 '11 16:10

Darwin Tech


2 Answers

I was having the same problems. But, I think I figured it out. I believe the step you are missing is to add 'debug_toolbar' to your projects setting.py INSTALLED_APPS tuple. This solves it for me. Here is a link to the article that I used as a reference.

like image 60
David S Avatar answered Oct 17 '22 14:10

David S


The INTERNAL_IPS should be a list or tuple, not a string, so:

INTERNAL_IPS = ('127.0.0.1', )   # note, comma
like image 36
Michał Šrajer Avatar answered Oct 17 '22 12:10

Michał Šrajer