add static files, whitenoise and uvicorn

This commit is contained in:
Matteo Rosati
2026-02-10 23:43:04 +01:00
parent 4a4ec50771
commit 4ba453b7a6
8 changed files with 114 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@@ -121,6 +122,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/6.0/howto/static-files/
STATIC_URL = "static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
WHITENOISE_USE_FINDERS = True
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (