Django-debug-toolbar: 404 error on django 2.2

Created on 7 Apr 2019  路  6Comments  路  Source: jazzband/django-debug-toolbar

django:2.2
python:3.7.3

in django 2.1 it's work

but in django 2.2 , i got 404 error

image

image

image

Most helpful comment

To offer some potential closure on this issue, the problem may be that an earlier pattern is claiming the __debug__/ path. For example, a catch-all pattern like this: url(r"", include(app_urls)),

In this case, the workaround is to put the debug toolbar path earlier in the list. For example:

if settings.DEBUG:
    import debug_toolbar
    urlpatterns.insert(0, path('__debug__/', include(debug_toolbar.urls)))

All 6 comments

when i remove django-debug-toolbar code in urls.py and in settings.py, it's work ok

image

In Django 2.2 I use such code:

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [path('__debug__/', include(debug_toolbar.urls))]

thank you @kwist-sgr

but it's not work,
i used django 2.2
python 3.7.3

I have the exact same issue. I'm not sure why it was closed.

Same issue

To offer some potential closure on this issue, the problem may be that an earlier pattern is claiming the __debug__/ path. For example, a catch-all pattern like this: url(r"", include(app_urls)),

In this case, the workaround is to put the debug toolbar path earlier in the list. For example:

if settings.DEBUG:
    import debug_toolbar
    urlpatterns.insert(0, path('__debug__/', include(debug_toolbar.urls)))
Was this page helpful?
0 / 5 - 0 ratings