From 63874cf9820ee82050d3d11ba12212c197821fcd Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sat, 27 Jan 2024 18:06:05 +0100 Subject: add impersonation --- manager/settings.py | 8 +++++++- manager/urls.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'manager') diff --git a/manager/settings.py b/manager/settings.py index c2ffdf6..e145e45 100644 --- a/manager/settings.py +++ b/manager/settings.py @@ -66,6 +66,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'impersonate', ] MIDDLEWARE = [ @@ -76,6 +77,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'impersonate.middleware.ImpersonateMiddleware', ] AUTHLIB_OAUTH_CLIENTS = { @@ -174,4 +176,8 @@ STATICFILES_DIRS = [ LOGIN_REDIRECT_URL = '/' LOGOUT_REDIRECT_URL = '/' -FQD_BASE_URL = 'http://127.0.0.1:8000' \ No newline at end of file +FQD_BASE_URL = 'http://127.0.0.1:8000' + +# Impersonate settings +REQUIRE_SUPERUSER = True +ALLOW_SUPERUSER = False \ No newline at end of file diff --git a/manager/urls.py b/manager/urls.py index f3b8008..beaefbe 100644 --- a/manager/urls.py +++ b/manager/urls.py @@ -23,6 +23,7 @@ urlpatterns = [ path('accounts/', include('accounts.urls')), path('accounts/', include('django.contrib.auth.urls')), path('admin/', admin.site.urls), + path('impersonate/', include('impersonate.urls')), ] if settings.DEBUG: -- cgit v1.2.1