use X-Forwarded-* headers in django config
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
j3d1 2023-10-23 00:11:50 +02:00
parent 5faec68ebf
commit 49de2decca

View file

@ -13,8 +13,6 @@ import os
import dotenv import dotenv
from pathlib import Path from pathlib import Path
from django.contrib import staticfiles
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@ -29,11 +27,10 @@ if SECRET_KEY is None:
DEBUG = os.environ.get('DEBUG', 'False').lower() == 'true' DEBUG = os.environ.get('DEBUG', 'False').lower() == 'true'
if DEBUG:
print('DEBUG mode is enabled')
# Application definition # Application definition
TOOLSHED_VERSION = "0.0.0-dev.0"
INSTALLED_APPS = [ INSTALLED_APPS = [
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
@ -85,6 +82,9 @@ CSRF_TRUSTED_ORIGINS = ['https://' + host for host in ALLOWED_HOSTS]
CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_ALL_ORIGINS = True
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ROOT_URLCONF = 'backend.urls' ROOT_URLCONF = 'backend.urls'
TEMPLATES = [ TEMPLATES = [
@ -177,4 +177,5 @@ STORAGES = {
}, },
} }
DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 128 # 128 MB
TEST_RUNNER = 'backend.test_runner.FastTestRunner' TEST_RUNNER = 'backend.test_runner.FastTestRunner'