0

Django 3.0.6

Main urls.py

urlpatterns = [
    path('', HomeView.as_view(), name='home'),
    path('{}'.format("admin/" if DEBUG else "dhjfsljdasdhje32/"), admin.site.urls), # Change admin url for security reasons.
    path('post/', include('post.urls')),
]

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

post.urls.py

urlpatterns = [
    path('<int:pk>/', PostDetailView.as_view(), name='detail'),
]

Problem

When I try these addresses: http://localhost:8000/, http://localhost:8000/admin/, Django Debut Toolbar is showing.

But when I try http://localhost:8000/post/1/, the debug toolbar is not showing.

Supposedly, it has something to do with include. But I'm not sure.

Could you hep me here?

Michael
  • 4,273
  • 3
  • 40
  • 69
  • What makes you think it has something to do with include? Sometimes I have to do a hard refresh of the page to get the toolbar to show up. Check the console.log for any clues. – Ben May 13 '20 at 15:51

1 Answers1

0

Your DetailView template contains closing tag </body>? I had similar problem because one of my pages didn't has this tag.

ImustAdmit
  • 388
  • 4
  • 14