|
9 | 9 | # Please check the next links for details about the configuration |
10 | 10 | # in a production environment: |
11 | 11 | # |
12 | | -# https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
13 | | -# https://docs.djangoproject.com/en/3.1/ref/settings/ |
| 12 | +# https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ |
| 13 | +# https://docs.djangoproject.com/en/5.2/ref/settings/ |
14 | 14 | # |
15 | 15 | import json |
16 | 16 | import os |
|
28 | 28 | # |
29 | 29 | # You must never enable debug in production. |
30 | 30 | # |
31 | | -# https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DEBUG |
| 31 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#std:setting-DEBUG |
32 | 32 | # |
33 | 33 |
|
34 | 34 | DEBUG = os.environ.get('SORTINGHAT_DEBUG', 'False').lower() in ('true', '1') |
|
38 | 38 | # If DEBUG is set to False, you will need to configure this parameter, |
39 | 39 | # with the host you are using to serve SortingHat. |
40 | 40 | # |
41 | | -# https://docs.djangoproject.com/en/3.1/ref/settings/#allowed-hosts |
| 41 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#allowed-hosts |
42 | 42 | # |
43 | 43 |
|
44 | 44 | if 'SORTINGHAT_ALLOWED_HOST' in os.environ: |
|
52 | 52 | # |
53 | 53 | # The secret key must be a large random value and it must be kept secret. |
54 | 54 | # |
55 | | -# https://docs.djangoproject.com/en/3.1/ref/settings/#secret-key |
| 55 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#secret-key |
56 | 56 | # |
57 | 57 |
|
58 | 58 | SECRET_KEY = os.environ['SORTINGHAT_SECRET_KEY'] |
|
130 | 130 | # |
131 | 131 | # Password validation |
132 | 132 | # |
133 | | -# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators |
| 133 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators |
134 | 134 | # |
135 | 135 |
|
136 | 136 | AUTH_PASSWORD_VALIDATORS = [ |
|
172 | 172 | # |
173 | 173 | # Static files (CSS, JavaScript, Images) |
174 | 174 | # |
175 | | -# https://docs.djangoproject.com/en/4.2/howto/static-files/ |
| 175 | +# https://docs.djangoproject.com/en/5.2/howto/static-files/ |
176 | 176 | # |
177 | 177 |
|
178 | 178 | STATIC_URL = '/' |
|
181 | 181 | # Current supported cloud platforms are: GCP |
182 | 182 | if 'SORTINGHAT_STATICFILES_STORAGE' in os.environ: |
183 | 183 | if os.environ['SORTINGHAT_STATICFILES_STORAGE'].lower() == 'gcp': |
184 | | - STATICFILES_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' |
185 | | - GS_BUCKET_NAME = os.environ['SORTINGHAT_BUCKET_NAME'] |
| 184 | + STORAGES = { |
| 185 | + "staticfiles": { |
| 186 | + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", |
| 187 | + "OPTIONS": {"bucket_name": os.environ["SORTINGHAT_BUCKET_NAME"]}, |
| 188 | + } |
| 189 | + } |
186 | 190 | else: |
187 | 191 | raise ValueError(f"'{os.environ['SORTINGHAT_STATICFILES_STORAGE']}' storage is not supported") |
188 | 192 |
|
|
201 | 205 | # |
202 | 206 | # Internationalization |
203 | 207 | # |
204 | | -# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
| 208 | +# https://docs.djangoproject.com/en/5.2/topics/i18n/ |
205 | 209 | # |
206 | 210 | # |
207 | 211 |
|
|
218 | 222 | # |
219 | 223 | # SortingHat Logging |
220 | 224 | # |
221 | | -# https://docs.djangoproject.com/en/3.1/topics/logging/#configuring-logging |
| 225 | +# https://docs.djangoproject.com/en/5.2/topics/logging/#configuring-logging |
222 | 226 | # |
223 | 227 |
|
224 | 228 | LOGGING = { |
|
370 | 374 | # |
371 | 375 | # Path of the permission groups configuration file |
372 | 376 | # |
373 | | -# https://docs.djangoproject.com/en/5.0/topics/auth/default/#groups |
| 377 | +# https://docs.djangoproject.com/en/5.2/topics/auth/default/#groups |
374 | 378 | # |
375 | 379 |
|
376 | 380 | PERMISSION_GROUPS_LIST_PATH = os.environ.get('SORTINGHAT_PERMISSION_GROUPS_LIST_PATH', |
|
386 | 390 | # |
387 | 391 | # Session cookies configuration |
388 | 392 | # |
389 | | -# https://docs.djangoproject.com/en/4.2/topics/http/sessions/#settings |
| 393 | +# https://docs.djangoproject.com/en/5.2/topics/http/sessions/#settings |
390 | 394 | # |
391 | 395 |
|
392 | 396 | SESSION_COOKIE_AGE = 1800 |
|
0 commit comments