From 2730d8643ce772f106d9b10789e35b98e970098a Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 9 Oct 2026 22:26:28 +0200 Subject: [PATCH] Configure production settings for Raspberry Pi --- OpenSite/settings.py | 17 +++++++++++++++-- requirements.txt | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/OpenSite/settings.py b/OpenSite/settings.py index 5812f95..ec1f545 100644 --- a/OpenSite/settings.py +++ b/OpenSite/settings.py @@ -20,9 +20,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: don't run with debug turned on in production! SECRET_KEY = '@!zw2l8til1(0eb_nk+1w!(n78gqm&u)s)_v7#k6iseia@g9q0' -DEBUG = True +DEBUG = False -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = ['bench.rektdie.com'] HTML_MINIFY = True APPEND_SLASH = True @@ -132,3 +132,16 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' + +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') + +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') +SECURE_SSL_REDIRECT = True +SESSION_COOKIE_SECURE = True +CSRF_COOKIE_SECURE = True + +CSRF_TRUSTED_ORIGINS = ['https://bench.rektdie.com'] + +SECURE_HSTS_SECONDS = 31536000 +SECURE_HSTS_INCLUDE_SUBDOMAINS = True +SECURE_HSTS_PRELOAD = True diff --git a/requirements.txt b/requirements.txt index 9895386..48f5a99 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ Django==4.2.1 django-htmlmin==0.11.0 requests -scipy==1.9.0 +scipy==1.18.1