From 3d0f23833d5990d09f058812ada5a93b511054c2 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Mon, 6 May 2024 17:01:51 +0200 Subject: [PATCH] Allow session authentication in debug mode This allows using the browsable API in debug mode --- backend/ciso_assistant/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/ciso_assistant/settings.py b/backend/ciso_assistant/settings.py index c682a2237..1d6a8904a 100644 --- a/backend/ciso_assistant/settings.py +++ b/backend/ciso_assistant/settings.py @@ -202,6 +202,10 @@ def set_ciso_assistant_url(_, __, event_dict): REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"].append( "rest_framework.renderers.BrowsableAPIRenderer" ) + # Add session authentication to allow using the browsable API + REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"].append( + "rest_framework.authentication.SessionAuthentication" + ) INSTALLED_APPS.append("django.contrib.staticfiles") STATIC_URL = "/static/"