diff --git a/authentication/backends.py b/authentication/backends.py index 38f08d6..adc1f48 100644 --- a/authentication/backends.py +++ b/authentication/backends.py @@ -16,7 +16,6 @@ from mozilla_django_oidc.contrib.drf import OIDCAuthentication class CustomOIDCBackend(OIDCAuthenticationBackend): def get_username(self, claims): if 'preferred_username' in claims and not User.objects.filter(username=claims['preferred_username']).exists(): - print(claims['preferred_username']) return claims['preferred_username'] return super().get_username(claims) @@ -32,7 +31,6 @@ class CustomOIDCBackend(OIDCAuthenticationBackend): def get_userinfo(self, access_token, id_token, payload): userinfo = cache.get(f'userinfo-{access_token}') if userinfo is None: - print("no cache found for userinfo-{access_token} yet.") userinfo = super().get_userinfo(access_token, id_token, payload) if userinfo: cache.set(f'userinfo-{access_token}', userinfo, timeout=settings.OIDC_CACHE_USERINFO) diff --git a/marbas/settings.py b/marbas/settings.py index 9874400..7db6710 100644 --- a/marbas/settings.py +++ b/marbas/settings.py @@ -71,6 +71,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', @@ -166,8 +167,9 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_ROOT = 'static/' +STATIC_ROOT = BASE_DIR / 'static' STATIC_URL = 'static/' +STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field diff --git a/requirements.txt b/requirements.txt index 02ea6a0..4c05897 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,5 @@ inflection django-esi django-health-check mozilla-django-oidc -django-cors-headers \ No newline at end of file +django-cors-headers +whitenoise \ No newline at end of file