|
1 | 1 | """ |
2 | 2 | Django settings for gettingstarted project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 5.1. |
| 4 | +Generated by 'django-admin startproject' using Django 5.2. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/5.1/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/5.2/topics/settings/ |
8 | 8 |
|
9 | 9 | For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/5.1/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/5.2/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | 13 | import os |
|
21 | 21 |
|
22 | 22 |
|
23 | 23 | # Before using your Heroku app in production, make sure to review Django's deployment checklist: |
24 | | -# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ |
| 24 | +# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ |
25 | 25 |
|
26 | 26 | # Django requires a unique secret key for each Django app, that is used by several of its |
27 | 27 | # security features. To simplify initial setup (without hardcoding the secret in the source |
28 | 28 | # code) we set this to a random value every time the app starts. However, this will mean many |
29 | 29 | # Django features break whenever an app restarts (for example, sessions will be logged out). |
30 | 30 | # In your production Heroku apps you should set the `DJANGO_SECRET_KEY` config var explicitly. |
31 | 31 | # Make sure to use a long unique value, like you would for a password. See: |
32 | | -# https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-SECRET_KEY |
| 32 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#std-setting-SECRET_KEY |
33 | 33 | # https://devcenter.heroku.com/articles/config-vars |
34 | 34 | # SECURITY WARNING: Keep the secret key used in production secret! |
35 | 35 | SECRET_KEY = os.environ.get( |
|
40 | 40 | # Django has a debug mode which shows more detailed error messages and also means static assets |
41 | 41 | # can be served without having to run the production `collectstatic` command. However, this |
42 | 42 | # debug mode *must only be enabled in development* for security and performance reasons: |
43 | | -# https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-DEBUG |
| 43 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#std-setting-DEBUG |
44 | 44 | # Debug mode will be automatically enabled when the project is run via `heroku local` (which |
45 | 45 | # loads the environment variables set in the `.env` file, where `ENVIRONMENT=development`). |
46 | 46 | # SECURITY WARNING: Don't run with debug turned on in production! |
|
55 | 55 | # On Heroku, it's safe to use a wildcard for `ALLOWED_HOSTS`, since the Heroku router performs |
56 | 56 | # validation of the Host header in the incoming HTTP request. On other platforms you may need to |
57 | 57 | # list the expected hostnames explicitly in production to prevent HTTP Host header attacks. See: |
58 | | - # https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-ALLOWED_HOSTS |
| 58 | + # https://docs.djangoproject.com/en/5.2/ref/settings/#std-setting-ALLOWED_HOSTS |
59 | 59 | ALLOWED_HOSTS = ["*"] |
60 | 60 |
|
61 | 61 | # Redirect all non-HTTPS requests to HTTPS. This requires that: |
|
67 | 67 | # app's `gunicorn.conf.py` for how this is done when using gunicorn. |
68 | 68 | # |
69 | 69 | # For maximum security, consider enabling HTTP Strict Transport Security (HSTS) headers too: |
70 | | - # https://docs.djangoproject.com/en/5.1/ref/middleware/#http-strict-transport-security |
| 70 | + # https://docs.djangoproject.com/en/5.2/ref/middleware/#http-strict-transport-security |
71 | 71 | SECURE_SSL_REDIRECT = True |
72 | 72 | else: |
73 | 73 | ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0", "[::]"] |
|
78 | 78 | # Several optional Django features that are present in the default `startproject` template have |
79 | 79 | # been disabled since they are not used by this example app. To use them, uncomment the relevant |
80 | 80 | # entries in `INSTALLED_APPS`, `MIDDLEWARE`, `TEMPLATES` and `urls.py`. See: |
81 | | -# https://docs.djangoproject.com/en/5.1/ref/contrib/admin/ |
82 | | -# https://docs.djangoproject.com/en/5.1/topics/auth/ |
83 | | -# https://docs.djangoproject.com/en/5.1/ref/contrib/contenttypes/ |
84 | | -# https://docs.djangoproject.com/en/5.1/topics/http/sessions/ |
85 | | -# https://docs.djangoproject.com/en/5.1/ref/contrib/messages/ |
| 81 | +# https://docs.djangoproject.com/en/5.2/ref/contrib/admin/ |
| 82 | +# https://docs.djangoproject.com/en/5.2/topics/auth/ |
| 83 | +# https://docs.djangoproject.com/en/5.2/ref/contrib/contenttypes/ |
| 84 | +# https://docs.djangoproject.com/en/5.2/topics/http/sessions/ |
| 85 | +# https://docs.djangoproject.com/en/5.2/ref/contrib/messages/ |
86 | 86 | INSTALLED_APPS = [ |
87 | 87 | # Use WhiteNoise's runserver implementation instead of the Django default, for dev-prod parity. |
88 | 88 | "whitenoise.runserver_nostatic", |
|
119 | 119 | "APP_DIRS": True, |
120 | 120 | "OPTIONS": { |
121 | 121 | "context_processors": [ |
122 | | - "django.template.context_processors.debug", |
123 | 122 | "django.template.context_processors.request", |
124 | 123 | # "django.contrib.auth.context_processors.auth", |
125 | 124 | # "django.contrib.messages.context_processors.messages", |
|
132 | 131 |
|
133 | 132 |
|
134 | 133 | # Database |
135 | | -# https://docs.djangoproject.com/en/5.1/ref/settings/#databases |
| 134 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#databases |
136 | 135 |
|
137 | 136 | if IS_HEROKU_APP: |
138 | 137 | # In production on Heroku the database configuration is derived from the `DATABASE_URL` |
|
160 | 159 |
|
161 | 160 |
|
162 | 161 | # Password validation |
163 | | -# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators |
| 162 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators |
164 | 163 |
|
165 | 164 | AUTH_PASSWORD_VALIDATORS = [ |
166 | 165 | { |
|
179 | 178 |
|
180 | 179 |
|
181 | 180 | # Internationalization |
182 | | -# https://docs.djangoproject.com/en/5.1/topics/i18n/ |
| 181 | +# https://docs.djangoproject.com/en/5.2/topics/i18n/ |
183 | 182 |
|
184 | 183 | LANGUAGE_CODE = "en-us" |
185 | 184 |
|
|
191 | 190 |
|
192 | 191 |
|
193 | 192 | # Static files (CSS, JavaScript, Images) |
194 | | -# https://docs.djangoproject.com/en/5.1/howto/static-files/ |
| 193 | +# https://docs.djangoproject.com/en/5.2/howto/static-files/ |
195 | 194 |
|
196 | 195 | STATIC_ROOT = BASE_DIR / "staticfiles" |
197 | 196 | STATIC_URL = "static/" |
|
210 | 209 |
|
211 | 210 |
|
212 | 211 | # Default primary key field type |
213 | | -# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field |
| 212 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field |
214 | 213 |
|
215 | 214 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
216 | 215 |
|
217 | 216 | # Customise the default logging config, since by default full Django logs are only emitted when |
218 | 217 | # `DEBUG=True` (which otherwise makes diagnosing errors much harder in production): |
219 | | -# https://docs.djangoproject.com/en/5.1/ref/logging/#default-logging-configuration |
| 218 | +# https://docs.djangoproject.com/en/5.2/ref/logging/#default-logging-configuration |
220 | 219 | # For more advanced logging you may want to try: https://django-structlog.readthedocs.io |
221 | 220 | LOGGING = { |
222 | 221 | "version": 1, |
|
0 commit comments