Skip to content

Commit b06b06d

Browse files
committed
Add tasks initial migration
1 parent b60518e commit b06b06d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ lint:
2121

2222
test:
2323
uv run pytest -v
24-

task_manager/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
ALLOWED_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

@@ -90,7 +92,7 @@
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

@@ -133,3 +135,7 @@
133135
LOGIN_URL = "users:login"
134136
LOGIN_REDIRECT_URL = "users:list"
135137
LOGOUT_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

0 commit comments

Comments
 (0)