AI security fixes
This commit is contained in:
7
blechreiz/context_processors.py
Normal file
7
blechreiz/context_processors.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import os
|
||||
|
||||
|
||||
def google_maps(request):
|
||||
return {
|
||||
"GOOGLE_MAPS_API_KEY": os.environ.get("GOOGLE_MAPS_API_KEY", ""),
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user