diff --git a/djangorota/djangorota/urls.py b/djangorota/djangorota/urls.py index 3ed2619..077f210 100644 --- a/djangorota/djangorota/urls.py +++ b/djangorota/djangorota/urls.py @@ -25,10 +25,7 @@ urlpatterns = [ ] if settings.DEBUG: - try: - import debug_toolbar - - urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns - except Exception: - # debug_toolbar not installed; skip - pass + # Include django-debug-toolbar when running in DEBUG mode. Use a string + # include so the project doesn't fail to import if the package isn't + # installed; developers should install it in their dev environment. + urlpatterns = [path("__debug__/", include("debug_toolbar.urls"))] + urlpatterns