Pamela Fox
commited on
Commit
·
7300489
1
Parent(s):
ef6a6c4
whitenoise
Browse files- quizsite/settings.py +6 -0
- requirements.txt +2 -1
quizsite/settings.py
CHANGED
@@ -39,11 +39,13 @@ INSTALLED_APPS = [
|
|
39 |
"django.contrib.contenttypes",
|
40 |
"django.contrib.sessions",
|
41 |
"django.contrib.messages",
|
|
|
42 |
"django.contrib.staticfiles",
|
43 |
]
|
44 |
|
45 |
MIDDLEWARE = [
|
46 |
"django.middleware.security.SecurityMiddleware",
|
|
|
47 |
"django.contrib.sessions.middleware.SessionMiddleware",
|
48 |
"django.middleware.common.CommonMiddleware",
|
49 |
"django.middleware.csrf.CsrfViewMiddleware",
|
@@ -122,6 +124,10 @@ USE_TZ = True
|
|
122 |
|
123 |
STATIC_URL = "static/"
|
124 |
|
|
|
|
|
|
|
|
|
125 |
# Default primary key field type
|
126 |
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
127 |
|
|
|
39 |
"django.contrib.contenttypes",
|
40 |
"django.contrib.sessions",
|
41 |
"django.contrib.messages",
|
42 |
+
"whitenoise.runserver_nostatic",
|
43 |
"django.contrib.staticfiles",
|
44 |
]
|
45 |
|
46 |
MIDDLEWARE = [
|
47 |
"django.middleware.security.SecurityMiddleware",
|
48 |
+
"whitenoise.middleware.WhiteNoiseMiddleware",
|
49 |
"django.contrib.sessions.middleware.SessionMiddleware",
|
50 |
"django.middleware.common.CommonMiddleware",
|
51 |
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
124 |
|
125 |
STATIC_URL = "static/"
|
126 |
|
127 |
+
# https://whitenoise.evans.io/en/stable/django.html
|
128 |
+
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
129 |
+
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
130 |
+
|
131 |
# Default primary key field type
|
132 |
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
133 |
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
Django==4.1.1
|
2 |
psycopg2
|
3 |
-
python-dotenv
|
|
|
|
1 |
Django==4.1.1
|
2 |
psycopg2
|
3 |
+
python-dotenv
|
4 |
+
whitenoise
|