File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 13
13
import os
14
14
import dj_database_url
15
15
16
+ ENVIRONMENT = os .getenv ('ENVIRONMENT' , 'development' )
17
+
16
18
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17
19
BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
18
20
122
124
123
125
STATIC_URL = '/static/'
124
126
STATIC_ROOT = os .path .join (BASE_DIR , 'staticfiles' )
125
- STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
126
127
127
128
# Django REST Framework
128
129
REST_FRAMEWORK = {
129
130
'PAGE_SIZE' : 10 ,
130
131
'DEFAULT_PAGINATION_CLASS' :
131
132
'rest_framework.pagination.PageNumberPagination' ,
132
133
}
134
+
135
+ if ENVIRONMENT == 'production' :
136
+ DEBUG = False
137
+ SECRET_KEY = os .getenv ('SECRET_KEY' )
138
+ SESSION_COOKIE_SECURE = True
139
+ SECURE_BROWSER_XSS_FILTER = True
140
+ SECURE_CONTENT_TYPE_NOSNIFF = True
141
+ SECURE_HSTS_INCLUDE_SUBDOMAINS = True
142
+ SECURE_HSTS_SECONDS = 31536000
143
+ SECURE_REDIRECT_EXEMPT = []
144
+ SECURE_SSL_REDIRECT = True
145
+ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO' , 'https' )
You can’t perform that action at this time.
0 commit comments