Filter demo-data plugins from production settings
This commit is contained in:
@@ -27,6 +27,14 @@ INSTALLED_APPS = [
|
|||||||
"mandelstudio",
|
"mandelstudio",
|
||||||
] + INSTALLED_APPS
|
] + INSTALLED_APPS
|
||||||
|
|
||||||
|
# Never allow demo-data plugins in this production project context.
|
||||||
|
def _is_demo_data_app(app_label: str) -> bool:
|
||||||
|
normalized = "".join(ch for ch in app_label.lower() if ch.isalnum())
|
||||||
|
return "demodata" in normalized
|
||||||
|
|
||||||
|
|
||||||
|
INSTALLED_APPS = [app for app in INSTALLED_APPS if not _is_demo_data_app(app)]
|
||||||
|
|
||||||
# Route through the project URL layer so MandelStudio can override
|
# Route through the project URL layer so MandelStudio can override
|
||||||
# sitemap/robots behavior while still delegating the main Ocyan routes.
|
# sitemap/robots behavior while still delegating the main Ocyan routes.
|
||||||
ROOT_URLCONF = "mandelstudio.urls"
|
ROOT_URLCONF = "mandelstudio.urls"
|
||||||
|
|||||||
Reference in New Issue
Block a user