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 1313import os
1414import dj_database_url
1515
16+ ENVIRONMENT = os .getenv ('ENVIRONMENT' , 'development' )
17+
1618# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1719BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
1820
122124
123125STATIC_URL = '/static/'
124126STATIC_ROOT = os .path .join (BASE_DIR , 'staticfiles' )
125- STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
126127
127128# Django REST Framework
128129REST_FRAMEWORK = {
129130 'PAGE_SIZE' : 10 ,
130131 'DEFAULT_PAGINATION_CLASS' :
131132 'rest_framework.pagination.PageNumberPagination' ,
132133}
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