|
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
|
|
+import os
|
|
|
|
|
|
|
|
# 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
|
|
@@ -25,7 +26,10 @@ SECRET_KEY = 'django-insecure-qb$!mc5&7qcph*kb&j@x$$zce*i9-3es0%9lw$x89n1nl6ncjy
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
DEBUG = True
|
|
DEBUG = True
|
|
|
|
|
|
|
|
-ALLOWED_HOSTS = []
|
|
|
|
|
|
|
+ALLOWED_HOSTS = [".rancher.lab", "127.0.0.1", "localhost"]
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+CSRF_TRUSTED_ORIGINS = ["http://*.rancher.lab", "http://trgen.rancher.lab:30343", "http://localhost:30343", "http://127.0.0.1"]
|
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
# Application definition
|
|
@@ -75,16 +79,19 @@ WSGI_APPLICATION = 'doc_generator.wsgi.application'
|
|
|
|
|
|
|
|
|
|
|
|
|
# Database
|
|
# Database
|
|
|
-# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
|
|
|
|
|
|
+# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
|
DATABASES = {
|
|
|
'default': {
|
|
'default': {
|
|
|
- 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
|
- 'NAME': BASE_DIR / 'db.sqlite3',
|
|
|
|
|
|
|
+ "ENGINE": "django.db.backends.postgresql",
|
|
|
|
|
+ "NAME": "trgenerator",
|
|
|
|
|
+ "USER": "creylopez",
|
|
|
|
|
+ "PASSWORD": "Dsa-0213",
|
|
|
|
|
+ "HOST": os.environ.get('SQL_HOST','postgres-cluster-rw.siemens-pg-cluster.svc.cluster.local'),
|
|
|
|
|
+ "PORT": "5432",
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
# Password validation
|
|
# Password validation
|
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
@@ -103,6 +110,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+AUTH_USER_MODEL = "siemensusers.SiemensUser"
|
|
|
|
|
|
|
|
# Internationalization
|
|
# Internationalization
|
|
|
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
@@ -119,7 +127,12 @@ USE_TZ = True
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
|
|
|
|
|
|
-STATIC_URL = 'static/'
|
|
|
|
|
|
|
+STATIC_URL = '/static/'
|
|
|
|
|
+STATIC_ROOT = BASE_DIR / "staticfiles"
|
|
|
|
|
+STATICFILES_DIRS = [BASE_DIR / "static",]
|
|
|
|
|
+STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
|
|
|
+MEDIA_URL = '/media/'
|
|
|
|
|
+MEDIA_ROOT = BASE_DIR / "media"
|
|
|
|
|
|
|
|
# Default primary key field type
|
|
# Default primary key field type
|
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
@@ -138,4 +151,4 @@ TINYMCE_DEFAULT_CONFIG = {
|
|
|
"backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | "
|
|
"backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | "
|
|
|
"insertfile image media template link anchor codesample | ltr rtl",
|
|
"insertfile image media template link anchor codesample | ltr rtl",
|
|
|
"custom_undo_redo_levels": 10,
|
|
"custom_undo_redo_levels": 10,
|
|
|
-}
|
|
|
|
|
|
|
+}
|