Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Debug Toolbar in Heroku

Tags:

django

heroku

How can I use Django Debug Toolbar in Heroku when I don't know the IP address so this:

INTERNAL_IPS = ('127.0.0.1', )

Always fails.

like image 619
igorgue Avatar asked Mar 05 '12 12:03

igorgue


1 Answers

I have the following in my settings.py, which works both locally and when I deploy to Heroku:

MIDDLEWARE_CLASSES = (
  ...
  'debug_toolbar.middleware.DebugToolbarMiddleware'
 ...
)

if DEBUG is True:
   INSTALLED_APPS += (
       'debug_toolbar',
       )

if DEBUG is True:
  class AllIPS(list):
      def __contains__(self, item):
           return True
  INTERNAL_IPS = AllIPS()
like image 93
TAH Avatar answered Oct 17 '22 09:10

TAH