diff --git a/annuaire/urls.py b/annuaire/urls.py index dadfa71..f2f5a97 100644 --- a/annuaire/urls.py +++ b/annuaire/urls.py @@ -14,10 +14,9 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.conf import settings -from django.contrib import admin -from django.urls import path, include from django.conf.urls.static import static -from fiches.views import BirthdayView, HomeView +from django.contrib import admin +from django.urls import include, path urlpatterns = [ path("", include("fiches.urls")), @@ -26,5 +25,9 @@ urlpatterns = [ path("i18n/", include("django.conf.urls.i18n")), ] -if settings.DEBUG: - urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +if settings.DEBUG and "debug_toolbar" in settings.INSTALLED_APPS: + from debug_toolbar import urls as debug_urls + + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + [ + path("__debug__/", include(debug_urls)) + ]