Skip to content

Instantly share code, notes, and snippets.

@andrewpetrochenkov
Last active August 3, 2024 15:54
Show Gist options
  • Save andrewpetrochenkov/572dd1dfa1dccf6b56ace91607c11a12 to your computer and use it in GitHub Desktop.
Save andrewpetrochenkov/572dd1dfa1dccf6b56ace91607c11a12 to your computer and use it in GitHub Desktop.
Django settings SSL HTTPS #django #ssl
# https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
if '1' in str(os.getenv('SECURE_SSL')): # SECURE_SSL=1
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment