AI security fixes

This commit is contained in:
2026-04-08 21:23:12 +02:00
parent 2beb7aa75a
commit 149a488795
9 changed files with 279 additions and 17 deletions

View File

@@ -6,6 +6,13 @@ from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
# Load environment variables from .env file if python-dotenv is installed
try:
from dotenv import load_dotenv
load_dotenv(os.path.join(PROJECT_PATH, ".env"))
except ImportError:
pass
# Django settings for blechreiz project.
@@ -32,7 +39,7 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
EMAIL_HOST = "smtp.blechreiz.com"
EMAIL_HOST_USER = "m02b721a"
EMAIL_HOST_PASSWORD = "9Hp4WG5bZ2WVPX5z"
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD", "")
EMAIL_USE_TLS = False
@@ -83,7 +90,7 @@ STATICFILES_FINDERS = [
]
# Make this unique, and don't share it with anybody.
SECRET_KEY = "x$8&9s6t%eeg=wyhar87934wh_s$dbpm(73g4ho&n)9_wogj6p"
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
@@ -119,7 +126,6 @@ TEMPLATES = [
"django.template.context_processors.media",
"django.template.context_processors.static",
"sekizai.context_processors.sekizai",
"blechreiz.context_processors.google_maps",
],
},
},
@@ -165,18 +171,12 @@ GCAL_COUPLING = {
"eventPrefix": "Blechreiz: ",
"developerKey": "blechreiz-homepage",
"clientId": "34462582242-4kpdvvbi27ajt4u22uitqurpve9o8ipj.apps.googleusercontent.com",
"client_secret": "y4t9XBrJdCODPTO5UvtONWWn",
"client_secret": os.environ.get("GCAL_CLIENT_SECRET", ""),
"credentials_file": PROJECT_PATH + "/calendarCredentials.dat",
"push_url": "https://blechreiz.bauer.technology/eventplanner_gcal/gcalApiCallback",
}
# Google Maps API Key
# Get your API key from https://console.cloud.google.com/apis/credentials
# Enable the Maps JavaScript API and Geocoding API
GOOGLE_MAPS_API_KEY = "AIzaSyCf9Lm5ckjmVd08scTOd7fB1dC_UCoumKg"
# Crispy Forms configuration
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"