diff --git a/DataSpace/settings.py b/DataSpace/settings.py index 50a38dd..e1389d4 100644 --- a/DataSpace/settings.py +++ b/DataSpace/settings.py @@ -154,8 +154,12 @@ "api.middleware.logging.StructuredLoggingMiddleware", ] -# Add debug toolbar middleware if in debug mode +# Add debug toolbar app and middleware if in debug mode. Both are required -- +# the middleware alone crashes on any request/check that touches +# debug_toolbar's models: "HistoryEntry doesn't declare an explicit +# app_label and isn't in an application in INSTALLED_APPS". if DEBUG: + INSTALLED_APPS.append("debug_toolbar") MIDDLEWARE.insert(1, "debug_toolbar.middleware.DebugToolbarMiddleware") MIDDLEWARE += [