django-debug-toolbar and 404's

545 views
Skip to first unread message

Rishabh Manocha

unread,
Feb 10, 2010, 10:07:24 PM2/10/10
to django...@googlegroups.com
Hey Guys,

I know I must be doing something stupid here, but for the life of me, I can't seem to be able to get django-debug-toolbar to work - I keep getting a 404 error whenever I visit http://localhost:8000/admin/ (see [1]). I've followed the Installation instructions at http://github.com/robhudson/django-debug-toolbar. Here are the relevant sections of my 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',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
)

ROOT_URLCONF = 'testproject.urls'
...
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'testapp',
    'debug_toolbar',
)

INTERNAL_IPS = ('127.0.0.1', )


from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^testproject/', include('testproject.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)

This is running against 'Django version 1.2 beta 1', python 2.5.and the latest checkout of django-debug-toolbar from github (if it matters, I've symlinked the debug_toolbar folder into my site-packages).

I'd really appreciate pointers as to what I'm doing wrong here.

--

Best,

R

Mike Dewhirst

unread,
Feb 10, 2010, 10:56:41 PM2/10/10
to django...@googlegroups.com
Rishab

Maybe you haven't included any toolbar panels?

Here is an example ...

if TOOLBAR:
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': TOOLBAR_REDIRECTS,
'SHOW_TOOLBAR_CALLBACK': None,
}

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.logger.LoggingPanel',
)

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

INSTALLED_APPS += (
'debug_toolbar',
)

Mike

> and my testproject.urls.py <http://testproject.urls.py>:


>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Example:
> # (r'^testproject/', include('testproject.foo.urls')),
>
> # Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
> # to INSTALLED_APPS to enable admin documentation:
> # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> (r'^admin/', include(admin.site.urls)),
> )
>
> This is running against 'Django version 1.2 beta 1', python 2.5.and the
> latest checkout of django-debug-toolbar from github (if it matters, I've
> symlinked the debug_toolbar folder into my site-packages).
>
> I'd really appreciate pointers as to what I'm doing wrong here.
>
> --
>
> Best,
>
> R
>
> [1] - http://i.imgur.com/5GkiQ.png
>

> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Rishabh Manocha

unread,
Feb 12, 2010, 1:57:11 AM2/12/10
to django...@googlegroups.com
Mike,

Thanks for replying. Reading through the django-debug-toolbar docs, those settings are all optional, so I just figured I don't need to set them for the default debug-toolbar functionality. I'll give it a shot though, just to make sure.

Anybody else have any ideas??

--

Best,

R

Rob Hudson

unread,
Feb 12, 2010, 9:41:06 AM2/12/10
to Django users
Can you test it by disabling the debug toolbar middleware? I've
duplicated your exact settings as much as I can and it's working for
me. If disabling the middleware makes the admin appear, then it would
seem something in the toolbar is causing the problem.

And you are right... those settings you refer to are optional.

Thanks,
Rob

Rishabh Manocha

unread,
Feb 12, 2010, 11:24:09 PM2/12/10
to django...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


Rob,

Disabling the debug toolbar middleware does make the admin appear.

I have now fixed my problem though. It seems it had something to do with creating a symlink in my site-packages folder to the debug_toolbar folder in my git checkout. Running 'setup.py install' fixed my issues - everything shows up fine using the same settings.

Thanks for the help.

--

Best,

R
Reply all
Reply to author
Forward
0 new messages