|
2 | 2 | Django settings for pythonsd project. |
3 | 3 |
|
4 | 4 | For more information on this file, see |
5 | | -https://docs.djangoproject.com/en/3.2/topics/settings/ |
| 5 | +https://docs.djangoproject.com/en/4.2/topics/settings/ |
6 | 6 |
|
7 | 7 | For the full list of settings and their values, see |
8 | | -https://docs.djangoproject.com/en/3.2/ref/settings/ |
| 8 | +https://docs.djangoproject.com/en/4.2/ref/settings/ |
9 | 9 | """ |
10 | 10 |
|
11 | 11 | import json |
|
20 | 20 |
|
21 | 21 |
|
22 | 22 | # Quick-start development settings - unsuitable for production |
23 | | -# https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ |
| 23 | +# https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ |
24 | 24 |
|
25 | 25 | # SECURITY WARNING: keep the secret key used in production secret! |
26 | 26 | # SECURITY WARNING: don't run with debug turned on in production! |
|
82 | 82 |
|
83 | 83 |
|
84 | 84 | # Database |
85 | | -# https://docs.djangoproject.com/en/3.2/ref/settings/#databases |
| 85 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases |
86 | 86 | # -------------------------------------------------------------------------- |
87 | 87 | DATABASES = {"default": dj_database_url.config(default="sqlite:///db.sqlite3")} |
88 | 88 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
89 | 89 |
|
90 | 90 |
|
91 | 91 | # Internationalization |
92 | | -# https://docs.djangoproject.com/en/3.2/topics/i18n/ |
| 92 | +# https://docs.djangoproject.com/en/4.2/topics/i18n/ |
93 | 93 | # -------------------------------------------------------------------------- |
94 | 94 | LANGUAGE_CODE = "en-us" |
95 | 95 |
|
96 | 96 | TIME_ZONE = "America/Los_Angeles" |
97 | 97 |
|
98 | 98 | USE_I18N = True |
99 | 99 |
|
100 | | -USE_L10N = True |
101 | | - |
102 | 100 | USE_TZ = True |
103 | 101 |
|
104 | 102 |
|
105 | 103 | # Static files (CSS, JavaScript, Images) |
106 | | -# https://docs.djangoproject.com/en/3.2/howto/static-files/ |
| 104 | +# https://docs.djangoproject.com/en/4.2/howto/static-files/ |
| 105 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-STORAGES |
107 | 106 | # -------------------------------------------------------------------------- |
108 | 107 | STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") |
109 | 108 | STATIC_URL = "/static-files/" |
110 | | - |
111 | | -# Due to a bug relating to the manifest not being generated before the tests run |
112 | | -# We can't use CompressedManifestStaticFilesStorage (yet) |
113 | | -STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" |
114 | 109 | STATICFILES_DIRS = [ |
115 | 110 | os.path.join(BASE_DIR, "assets", "dist"), |
116 | 111 | os.path.join(BASE_DIR, "pythonsd", "static"), |
117 | 112 | ] |
118 | 113 |
|
| 114 | +STORAGES = { |
| 115 | + "default": { |
| 116 | + "BACKEND": "django.core.files.storage.FileSystemStorage", |
| 117 | + }, |
| 118 | + "staticfiles": { |
| 119 | + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", |
| 120 | + }, |
| 121 | +} |
| 122 | + |
119 | 123 | MEDIA_URL = os.environ.get("MEDIA_URL", default="/media/") |
120 | 124 | MEDIA_ROOT = os.path.join(BASE_DIR, "media") |
121 | 125 |
|
122 | 126 |
|
123 | 127 | # Email |
124 | | -# https://docs.djangoproject.com/en/3.2/topics/email/ |
| 128 | +# https://docs.djangoproject.com/en/4.2/topics/email/ |
125 | 129 | # -------------------------------------------------------------------------- |
126 | 130 | EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" |
127 | 131 | DEFAULT_FROM_EMAIL = "[email protected]" |
|
132 | 136 | # A sample logging configuration. The only tangible logging |
133 | 137 | # performed by this configuration is to send an email to |
134 | 138 | # the site admins on every HTTP 500 error when DEBUG=False. |
135 | | -# http://docs.djangoproject.com/en/3.2/topics/logging |
136 | | -# https://docs.djangoproject.com/en/3.2/ref/settings/#logging |
| 139 | +# http://docs.djangoproject.com/en/4.2/topics/logging |
| 140 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#logging |
137 | 141 | # -------------------------------------------------------------------------- |
138 | 142 | LOGGING = { |
139 | 143 | "version": 1, |
|
0 commit comments