|
@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
import os
|
|
import os
|
|
|
|
|
+from django.urls import reverse_lazy
|
|
|
|
|
|
|
|
# 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
|
|
@@ -81,16 +82,24 @@ WSGI_APPLICATION = 'doc_generator.wsgi.application'
|
|
|
# Database
|
|
# Database
|
|
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
|
|
|
|
|
|
|
-DATABASES = {
|
|
|
|
|
- 'default': {
|
|
|
|
|
- "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",
|
|
|
|
|
|
|
+if DEBUG:
|
|
|
|
|
+ DATABASES = {
|
|
|
|
|
+ 'default': {
|
|
|
|
|
+ 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
|
+ 'NAME': BASE_DIR / 'db.sqlite3',
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+else:
|
|
|
|
|
+ DATABASES = {
|
|
|
|
|
+ 'default': {
|
|
|
|
|
+ "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
|
|
@@ -136,7 +145,7 @@ STATIC_ROOT = BASE_DIR / "staticfiles"
|
|
|
STATICFILES_DIRS = [BASE_DIR / "static",]
|
|
STATICFILES_DIRS = [BASE_DIR / "static",]
|
|
|
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
|
MEDIA_URL = '/media/'
|
|
MEDIA_URL = '/media/'
|
|
|
-MEDIA_ROOT = BASE_DIR / "media"
|
|
|
|
|
|
|
+MEDIA_ROOT = BASE_DIR / "mediafiles"
|
|
|
|
|
|
|
|
# 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
|
|
@@ -155,4 +164,6 @@ 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,
|
|
|
|
|
+
|
|
|
|
|
+ "images_upload_url": reverse_lazy('tinymce_image_upload'),
|
|
|
}
|
|
}
|