1

I have been incorporating advice from various threads on debug-toolbar here, but somehow cannot get it working. Would appreciate some help please.

  1. I am not developing locally. The server hosting the code is a WebFaction server and I am testing it from a browser on my local machine. debug-toolbar is installed on the server and I can see it in the server's PYTHONPATH.

  2. IP address used is the tuple of (request.HTTP_X_FORWARDED_FOR, request.REMOTE_ADDR)

  3. When I use these same debug-toolbar settings in a fresh Django test project on my local machine, it works.

  4. One post mentioned that using show_toolbar and returning True voided all the IP address checks. I have tried that too (below) to no avail.

  5. (Edit) This works from shell. I can run python manage debugsqlshell

settings.py:

DEBUG = True

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',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
)


INSTALLED_APPS = (
    ....
    'debug_toolbar',   # last in list
)

# Debug toolbar settings
INTERNAL_IPS = ('x.x.x.x', 'y.y.y.y') 
# This is IP address from request.HTTP_X_FORWARDED_FOR and request.REMOTE_ADDR that I see when I put an assert 0 in the code.
# When I got desperate, I also tried adding'127.0.0.1', '10.0.2.2' to no avail


DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
)

# One post mentioned that using show_toolbar and returning True voided all the IP address checks. Trying it
def show_toolbar(request):
    return True

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
    'SHOW_TOOLBAR_CALLBACK': show_toolbar,
    'HIDE_DJANGO_SQL': False,
    'TAG': 'div',
}

page.html: ...

<body id="try">
    <meta http-equiv="content-type" content="text/html"; charset="UTF-8">
    ...stuff...
</body>

Now, what am I not seeing here?

4
  • I hope in "...stuff..." is a div tag, as that's the setting you have debug toolbar attaching too. (See 'TAG' parameter in DEBUG_TOOLBAR_CONFIG). Commented Nov 2, 2012 at 21:50
  • @Dan LaManna: Yes the page has many divs. I just added it incase there was something wrong with the body tag. I have also tried without TAG setting, but there is no difference. Commented Nov 3, 2012 at 16:25
  • 2
    Are you sure all the static files from the toolbar are in a place that are served by your server? This includes CSS and Javascript files that come with the toolbar. Commented Nov 20, 2012 at 10:01
  • @Alok that was the problem. The .js was not being loaded. Thanks a much! Could you please make your comment as an answer so that I can accept it? Commented Nov 20, 2012 at 22:51

1 Answer 1

1

Shouldn't your: <meta http-equiv="content-type" content="text/html"; charset="UTF-8"> be this instead? <meta http-equiv="Content-Type" content="text/html; charset=utf8" />

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.