Skip to content

Commit

Permalink
Added settings needed for reverse proxy setup
Browse files Browse the repository at this point in the history
Adding DJANGO_CSRF_TRUSTED_ORIGINS setting

Adding DJANGO_USE_X_FORWARDED_PORT

Adding CSRF_COOKIE_DOMAIN setting

Fixing USE_X_FORWARDED_HOST
  • Loading branch information
Harald Wilhelmi committed Feb 28, 2024
1 parent 33534cb commit cec01ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# ------------------------------------------------------------------------------
# Hosts/domain names that are valid for this site
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['*'])
USE_X_FORWARDED_HOST = env.bool('DJANGO_USE_X_FORWARDED_HOST', default=False)

# APP CONFIGURATION
# ------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
)
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
CSRF_TRUSTED_ORIGINS = env.list('DJANGO_CSRF_TRUSTED_ORIGINS', default=[])
CSRF_COOKIE_DOMAIN = env.str('DJANGO_CSRF_COOKIE_DOMAIN', default=None)
X_FRAME_OPTIONS = 'DENY'

INSTALLED_APPS += ['gunicorn']
Expand Down

0 comments on commit cec01ef

Please sign in to comment.