|
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 | +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
88 | 89 |
|
89 | 90 |
|
90 | 91 | # Internationalization |
91 | | -# https://docs.djangoproject.com/en/3.2/topics/i18n/ |
| 92 | +# https://docs.djangoproject.com/en/4.2/topics/i18n/ |
92 | 93 | # -------------------------------------------------------------------------- |
93 | 94 | LANGUAGE_CODE = "en-us" |
94 | 95 |
|
95 | 96 | TIME_ZONE = "America/Los_Angeles" |
96 | 97 |
|
97 | 98 | USE_I18N = True |
98 | 99 |
|
99 | | -USE_L10N = True |
100 | | - |
101 | 100 | USE_TZ = True |
102 | 101 |
|
103 | 102 |
|
104 | 103 | # Static files (CSS, JavaScript, Images) |
105 | | -# 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 |
106 | 106 | # -------------------------------------------------------------------------- |
107 | 107 | STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") |
108 | 108 | STATIC_URL = "/static-files/" |
109 | | - |
110 | | -# Due to a bug relating to the manifest not being generated before the tests run |
111 | | -# We can't use CompressedManifestStaticFilesStorage (yet) |
112 | | -STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" |
113 | 109 | STATICFILES_DIRS = [ |
114 | 110 | os.path.join(BASE_DIR, "assets", "dist"), |
115 | 111 | os.path.join(BASE_DIR, "pythonsd", "static"), |
116 | 112 | # Only available after running `npm install` |
117 | 113 | os.path.join(BASE_DIR, "node_modules/htmx.org/dist"), |
118 | 114 | ] |
119 | 115 |
|
120 | | -MEDIA_URL = "/media/" |
| 116 | +STORAGES = { |
| 117 | + "default": { |
| 118 | + "BACKEND": "django.core.files.storage.FileSystemStorage", |
| 119 | + }, |
| 120 | + "staticfiles": { |
| 121 | + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", |
| 122 | + }, |
| 123 | +} |
| 124 | + |
| 125 | +MEDIA_URL = os.environ.get("MEDIA_URL", default="/media/") |
121 | 126 | MEDIA_ROOT = os.path.join(BASE_DIR, "media") |
122 | 127 |
|
123 | 128 |
|
124 | 129 | # Email |
125 | | -# https://docs.djangoproject.com/en/3.2/topics/email/ |
| 130 | +# https://docs.djangoproject.com/en/4.2/topics/email/ |
126 | 131 | # -------------------------------------------------------------------------- |
127 | 132 | EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" |
128 | 133 | DEFAULT_FROM_EMAIL = "[email protected]" |
|
133 | 138 | # A sample logging configuration. The only tangible logging |
134 | 139 | # performed by this configuration is to send an email to |
135 | 140 | # the site admins on every HTTP 500 error when DEBUG=False. |
136 | | -# http://docs.djangoproject.com/en/3.2/topics/logging |
137 | | -# https://docs.djangoproject.com/en/3.2/ref/settings/#logging |
| 141 | +# http://docs.djangoproject.com/en/4.2/topics/logging |
| 142 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#logging |
138 | 143 | # -------------------------------------------------------------------------- |
139 | 144 | LOGGING = { |
140 | 145 | "version": 1, |
|
0 commit comments