4
4
Generated by 'django-admin startproject' using Django 2.2.5.
5
5
6
6
For more information on this file, see
7
- https://docs.djangoproject.com/en/2 .2/topics/settings/
7
+ https://docs.djangoproject.com/en/4 .2/topics/settings/
8
8
9
9
For the full list of settings and their values, see
10
- https://docs.djangoproject.com/en/2 .2/ref/settings/
10
+ https://docs.djangoproject.com/en/4 .2/ref/settings/
11
11
"""
12
12
13
13
import os
14
14
15
-
16
15
def get_secret (key , default = None ):
17
16
"""
18
17
Simple function to read an environment variable and return a default if the variable
@@ -26,13 +25,12 @@ def get_secret(key, default=None):
26
25
return f .read ().strip ()
27
26
return value
28
27
29
-
30
28
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
31
29
32
30
BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
33
31
34
32
# Quick-start development settings - unsuitable for production
35
- # See https://docs.djangoproject.com/en/2 .2/howto/deployment/checklist/
33
+ # See https://docs.djangoproject.com/en/4 .2/howto/deployment/checklist/
36
34
37
35
# SECURITY WARNING: keep the secret key used in production secret!
38
36
# Raises django's ImproperlyConfigured exception if SECRET_KEY not in os.environ
@@ -56,7 +54,7 @@ def get_secret(key, default=None):
56
54
if os .getenv ('ALLOWED_HOSTS' ):
57
55
ALLOWED_HOSTS = ALLOWED_HOSTS + get_secret ('ALLOWED_HOSTS' ).split (',' )
58
56
CSRF_TRUSTED_ORIGINS = [
59
- ' https://' + hostname if 'https://' not in hostname else hostname for hostname in ALLOWED_HOSTS ]
57
+ f" https://{ hostname } " if 'https://' not in hostname else hostname for hostname in ALLOWED_HOSTS ]
60
58
61
59
62
60
# Application definition
@@ -120,7 +118,7 @@ def get_secret(key, default=None):
120
118
121
119
122
120
# Database
123
- # https://docs.djangoproject.com/en/2 .2/ref/settings/#databases
121
+ # https://docs.djangoproject.com/en/4 .2/ref/settings/#databases
124
122
125
123
# Parse database connection url strings like psql://user:pass@127.0.0.1:8458/db
126
124
# read os.environ['DATABASE_URL'] and raises ImproperlyConfigured exception if not found
@@ -144,7 +142,7 @@ def get_secret(key, default=None):
144
142
145
143
146
144
# Cache
147
- # https://docs.djangoproject.com/en/2 .2/ref/settings/#caches
145
+ # https://docs.djangoproject.com/en/4 .2/ref/settings/#caches
148
146
149
147
CACHES = {
150
148
'default' : {
@@ -160,7 +158,7 @@ def get_secret(key, default=None):
160
158
161
159
162
160
# Password validation
163
- # https://docs.djangoproject.com/en/2 .2/ref/settings/#auth-password-validators
161
+ # https://docs.djangoproject.com/en/4 .2/ref/settings/#auth-password-validators
164
162
165
163
AUTH_PASSWORD_VALIDATORS = [
166
164
{
@@ -179,7 +177,7 @@ def get_secret(key, default=None):
179
177
180
178
181
179
# Internationalization
182
- # https://docs.djangoproject.com/en/2 .2/topics/i18n/
180
+ # https://docs.djangoproject.com/en/4 .2/topics/i18n/
183
181
184
182
LANGUAGE_CODE = 'en-us'
185
183
@@ -193,7 +191,7 @@ def get_secret(key, default=None):
193
191
194
192
195
193
# Static files (CSS, JavaScript, Images)
196
- # https://docs.djangoproject.com/en/2 .2/howto/static-files/
194
+ # https://docs.djangoproject.com/en/4 .2/howto/static-files/
197
195
198
196
STATIC_ROOT = os .path .join (BASE_DIR , 'static' )
199
197
STATIC_URL = 'static/'
@@ -214,7 +212,7 @@ def get_secret(key, default=None):
214
212
215
213
216
214
# Sessions
217
- # https://docs.djangoproject.com/en/3 .2/topics/http/sessions/
215
+ # https://docs.djangoproject.com/en/4 .2/topics/http/sessions/
218
216
219
217
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
220
218
@@ -223,13 +221,13 @@ def get_secret(key, default=None):
223
221
224
222
225
223
# Messages
226
- # https://docs.djangoproject.com/en/3 .2/ref/contrib/messages/
224
+ # https://docs.djangoproject.com/en/4 .2/ref/contrib/messages/
227
225
228
226
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
229
227
230
228
231
229
# Email
232
- # https://docs.djangoproject.com/en/3.1 /topics/email/
230
+ # https://docs.djangoproject.com/en/4.2 /topics/email/
233
231
234
232
if DEBUG :
235
233
EMAIL_BACKEND = get_secret ('EMAIL_BACKEND' , 'django.core.mail.backends.console.EmailBackend' )
@@ -272,6 +270,7 @@ def get_secret(key, default=None):
272
270
273
271
CELERY_BEAT_SCHEDULE = {}
274
272
273
+
275
274
# Discord
276
275
# https://discordpy.readthedocs.io/en/stable/
277
276
0 commit comments