|
1 | 1 | """ |
2 | 2 | Django settings for gettingstarted project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 5.2. |
| 4 | +Generated by 'django-admin startproject' using Django 6.0. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/5.2/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/6.0/topics/settings/ |
8 | 8 |
|
9 | 9 | For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/5.2/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/6.0/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.2/howto/deployment/checklist/ |
| 24 | +# See https://docs.djangoproject.com/en/6.0/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.2/ref/settings/#std-setting-SECRET_KEY |
| 32 | +# https://docs.djangoproject.com/en/6.0/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.2/ref/settings/#std-setting-DEBUG |
| 43 | +# https://docs.djangoproject.com/en/6.0/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.2/ref/settings/#std-setting-ALLOWED_HOSTS |
| 58 | + # https://docs.djangoproject.com/en/6.0/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.2/ref/middleware/#http-strict-transport-security |
| 70 | + # https://docs.djangoproject.com/en/6.0/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.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/ |
| 81 | +# https://docs.djangoproject.com/en/6.0/ref/contrib/admin/ |
| 82 | +# https://docs.djangoproject.com/en/6.0/topics/auth/ |
| 83 | +# https://docs.djangoproject.com/en/6.0/ref/contrib/contenttypes/ |
| 84 | +# https://docs.djangoproject.com/en/6.0/topics/http/sessions/ |
| 85 | +# https://docs.djangoproject.com/en/6.0/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", |
|
131 | 131 |
|
132 | 132 |
|
133 | 133 | # Database |
134 | | -# https://docs.djangoproject.com/en/5.2/ref/settings/#databases |
| 134 | +# https://docs.djangoproject.com/en/6.0/ref/settings/#databases |
135 | 135 |
|
136 | 136 | if IS_HEROKU_APP: |
137 | 137 | # In production on Heroku the database configuration is derived from the `DATABASE_URL` |
|
159 | 159 |
|
160 | 160 |
|
161 | 161 | # Password validation |
162 | | -# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators |
| 162 | +# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators |
163 | 163 |
|
164 | 164 | AUTH_PASSWORD_VALIDATORS = [ |
165 | 165 | { |
|
178 | 178 |
|
179 | 179 |
|
180 | 180 | # Internationalization |
181 | | -# https://docs.djangoproject.com/en/5.2/topics/i18n/ |
| 181 | +# https://docs.djangoproject.com/en/6.0/topics/i18n/ |
182 | 182 |
|
183 | 183 | LANGUAGE_CODE = "en-us" |
184 | 184 |
|
|
190 | 190 |
|
191 | 191 |
|
192 | 192 | # Static files (CSS, JavaScript, Images) |
193 | | -# https://docs.djangoproject.com/en/5.2/howto/static-files/ |
| 193 | +# https://docs.djangoproject.com/en/6.0/howto/static-files/ |
194 | 194 |
|
195 | 195 | STATIC_ROOT = BASE_DIR / "staticfiles" |
196 | 196 | STATIC_URL = "static/" |
|
207 | 207 | # https://whitenoise.readthedocs.io/en/latest/django.html#WHITENOISE_KEEP_ONLY_HASHED_FILES |
208 | 208 | WHITENOISE_KEEP_ONLY_HASHED_FILES = True |
209 | 209 |
|
210 | | - |
211 | | -# Default primary key field type |
212 | | -# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field |
213 | | - |
214 | | -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
215 | | - |
216 | 210 | # Customise the default logging config, since by default full Django logs are only emitted when |
217 | 211 | # `DEBUG=True` (which otherwise makes diagnosing errors much harder in production): |
218 | | -# https://docs.djangoproject.com/en/5.2/ref/logging/#default-logging-configuration |
| 212 | +# https://docs.djangoproject.com/en/6.0/ref/logging/#default-logging-configuration |
219 | 213 | # For more advanced logging you may want to try: https://django-structlog.readthedocs.io |
220 | 214 | LOGGING = { |
221 | 215 | "version": 1, |
|
0 commit comments