Skip to content

Commit 1d77f74

Browse files
committed
force https on heroku
1 parent abe75ea commit 1d77f74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python-in-edu/mysite/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@
171171
}
172172
}
173173

174+
if 'FORCE_HTTPS' in os.environ: # running on heroku
175+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
176+
SECURE_SSL_REDIRECT = True
174177

175178
# Password validation
176179
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

0 commit comments

Comments
 (0)