File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2121
2222test :
2323 uv run pytest -v
24-
Original file line number Diff line number Diff line change 3131
3232ALLOWED_HOSTS = [h for h in os .getenv ('ALLOWED_HOSTS' , 'webserver' ).split (',' ) if h ]
3333
34+ CSRF_TRUSTED_ORIGINS = [o for o in os .getenv ('CSRF_TRUSTED_ORIGINS' , 'https://*.onrender.com' ).split (',' ) if o ]
35+ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO' , 'https' )
3436
3537# Application definition
3638
9092 'default' : dj_database_url .parse (
9193 os .getenv ('DATABASE_URL' , f"sqlite:///{ BASE_DIR / 'db.sqlite3' } " ),
9294 conn_max_age = 600 ,
93- ssl_require = False
95+ ssl_require = os . getenv ( 'DB_SSL_REQUIRE' , ' False' ) == 'True'
9496 )
9597}
9698
133135LOGIN_URL = "users:login"
134136LOGIN_REDIRECT_URL = "users:list"
135137LOGOUT_REDIRECT_URL = "users:list"
138+
139+ SECURE_SSL_REDIRECT = (os .getenv ('SECURE_SSL_REDIRECT' , 'True' ) == 'True' ) and not DEBUG
140+ SESSION_COOKIE_SECURE = not DEBUG
141+ CSRF_COOKIE_SECURE = not DEBUG
You can’t perform that action at this time.
0 commit comments