Isolate staging and production settings paths
This commit is contained in:
@@ -36,19 +36,6 @@ INSTALLED_APPS = [
|
|||||||
"mandelstudio",
|
"mandelstudio",
|
||||||
] + INSTALLED_APPS
|
] + INSTALLED_APPS
|
||||||
|
|
||||||
# Ensure the canonical staging / production hostnames are accepted by Django.
|
|
||||||
# (Staging uses the welkomstaging domain; production uses mandelblog.com.)
|
|
||||||
_extra_allowed_hosts = [
|
|
||||||
"mandelstudio.welkombij.mandelblog.com",
|
|
||||||
"www.mandelblog.com",
|
|
||||||
"mandelblog.com",
|
|
||||||
]
|
|
||||||
if "ALLOWED_HOSTS" in globals():
|
|
||||||
for _host in _extra_allowed_hosts:
|
|
||||||
if _host not in ALLOWED_HOSTS:
|
|
||||||
ALLOWED_HOSTS.append(_host)
|
|
||||||
|
|
||||||
|
|
||||||
# Never allow demo-data plugins in this production project context.
|
# Never allow demo-data plugins in this production project context.
|
||||||
def _is_demo_data_app(app_label: str) -> bool:
|
def _is_demo_data_app(app_label: str) -> bool:
|
||||||
normalized = "".join(ch for ch in app_label.lower() if ch.isalnum())
|
normalized = "".join(ch for ch in app_label.lower() if ch.isalnum())
|
||||||
|
|||||||
14
mandelstudio/settings/env/prd.py
vendored
14
mandelstudio/settings/env/prd.py
vendored
@@ -6,9 +6,17 @@ except ModuleNotFoundError:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
STATIC_ROOT = "/srv/www/mandelstudio/static/"
|
STATIC_ROOT = "/srv/www/mandelstudio-prd/static/"
|
||||||
MEDIA_ROOT = "/srv/www/mandelstudio/media/"
|
MEDIA_ROOT = "/srv/www/mandelstudio-prd/media/"
|
||||||
PRIVATE_MEDIA_ROOT = "/srv/www/mandelstudio/private/"
|
PRIVATE_MEDIA_ROOT = "/srv/www/mandelstudio-prd/private/"
|
||||||
|
|
||||||
|
DATABASES["default"]["NAME"] = "/srv/www/mandelstudio-prd/db.sqlite3"
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = [
|
||||||
|
"www.mandelblog.com",
|
||||||
|
"mandelblog.com",
|
||||||
|
]
|
||||||
|
if "salt_target" in globals():
|
||||||
ALLOWED_HOSTS.append("mandelstudio.%s" % salt_target) # pylint: disable=E0602
|
ALLOWED_HOSTS.append("mandelstudio.%s" % salt_target) # pylint: disable=E0602
|
||||||
# pylint: disable=E0602
|
# pylint: disable=E0602
|
||||||
WAGTAILSEARCH_BACKENDS["default"]["URLS"] = ["https://search.mandelblog.com:9200"]
|
WAGTAILSEARCH_BACKENDS["default"]["URLS"] = ["https://search.mandelblog.com:9200"]
|
||||||
|
|||||||
12
mandelstudio/settings/env/stg.py
vendored
12
mandelstudio/settings/env/stg.py
vendored
@@ -6,11 +6,15 @@ except ModuleNotFoundError:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
STATIC_ROOT = "/srv/www/mandelstudio/static/"
|
STATIC_ROOT = "/srv/www/mandelstudio-stg/static/"
|
||||||
MEDIA_ROOT = "/srv/www/mandelstudio/media/"
|
MEDIA_ROOT = "/srv/www/mandelstudio-stg/media/"
|
||||||
PRIVATE_MEDIA_ROOT = "/srv/www/mandelstudio/private/"
|
PRIVATE_MEDIA_ROOT = "/srv/www/mandelstudio-stg/private/"
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["*"]
|
DATABASES["default"]["NAME"] = "/srv/www/mandelstudio-stg/db.sqlite3"
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = [
|
||||||
|
"mandelstudio.welkombij.mandelblog.com",
|
||||||
|
]
|
||||||
|
|
||||||
# Force mail to console
|
# Force mail to console
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
|
|||||||
Reference in New Issue
Block a user