Skip to content

Commit b2dc7cb

Browse files
Add ALLOWED_HOSTS env var
1 parent 6251386 commit b2dc7cb

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

SORT/settings.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
# Build paths inside the project like this: BASE_DIR / 'subdir'.
2020
BASE_DIR = Path(__file__).resolve().parent.parent
2121

22-
2322
# Quick-start development settings - unsuitable for production
2423
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
2524

@@ -29,8 +28,7 @@
2928
# SECURITY WARNING: don't run with debug turned on in production!
3029
DEBUG = True
3130

32-
ALLOWED_HOSTS = []
33-
31+
ALLOWED_HOSTS = os.getenv('DJANGO_ALLOWED_HOSTS', '').split()
3432

3533
# Application definition
3634

@@ -84,7 +82,6 @@
8482

8583
WSGI_APPLICATION = "SORT.wsgi.application"
8684

87-
8885
# Database
8986
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
9087

@@ -118,7 +115,6 @@
118115
},
119116
]
120117

121-
122118
# Internationalization
123119
# https://docs.djangoproject.com/en/5.1/topics/i18n/
124120

@@ -130,16 +126,13 @@
130126

131127
USE_TZ = True
132128

133-
134129
# Static files (CSS, JavaScript, Images)
135130
# https://docs.djangoproject.com/en/5.1/howto/static-files/
136131

137132
STATIC_URL = "static/"
138133

139134
STATICFILES_DIRS = [BASE_DIR / 'static']
140135

141-
142-
143136
# Default primary key field type
144137
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
145138

@@ -148,14 +141,13 @@
148141
LOGIN_REDIRECT_URL = "/"
149142
LOGOUT_REDIRECT_URL = "/"
150143

151-
152144
# FA: End session when the browser is closed
153145
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
154146

155147
# FA: 30 minutes before automatic log out
156148
SESSION_COOKIE_AGE = 1800
157149

158-
PASSWORD_RESET_TIMEOUT = 1800 # FA: default to expire after 30 minutes
150+
PASSWORD_RESET_TIMEOUT = 1800 # FA: default to expire after 30 minutes
159151

160152
# FA: for local testing emails:
161153

@@ -174,5 +166,4 @@
174166

175167
# FA: for production:
176168

177-
#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
178-
169+
# EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

0 commit comments

Comments
 (0)