Moving ALLOWED_HOSTS to env file

This commit is contained in:
Michael Bergbauer 2025-07-18 17:33:49 +02:00
parent 15750517f2
commit 69941166a1

View File

@ -12,7 +12,8 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
import pymysql
pymysql.install_as_MySQLdb()
from pathlib import Path
from decouple import config
from decouple import config, Csv
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -27,7 +28,7 @@ SECRET_KEY = 'django-insecure-tulz*odc=l1x(g^-=ne!y7^@lg1uce)=ha^!0wi5qkifq&#^sg
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = [ "albani.sternbauer.de" ]
ALLOWED_HOSTS = config("DJANGO_ALLOWED_HOSTS", default="localhost", cast=Csv())
# Application definition