Files
mandelstudio/mandelstudio/settings/base.py

84 lines
2.3 KiB
Python

"""
Django settings for de tilde project.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
from pathlib import Path
import sys
from configtype.jsonconfig import setup_search_paths
_project_app_path = Path(__file__).parent.parent
BASE_PATH = _project_app_path.parent
BASE_DIR = str(BASE_PATH)
setup_search_paths("/etc/ocyan/", str(_project_app_path))
from ocyan.main.settings import * # pylint:disable=W0401,W0614
INSTALLED_APPS = [
"mandelblog_content_guard.apps.MandelblogContentGuardConfig",
"mandelstudio",
] + INSTALLED_APPS
# Enable request language negotiation.
if "django.middleware.locale.LocaleMiddleware" not in MIDDLEWARE:
if "django.contrib.sessions.middleware.SessionMiddleware" in MIDDLEWARE:
idx = (
MIDDLEWARE.index("django.contrib.sessions.middleware.SessionMiddleware") + 1
)
MIDDLEWARE.insert(idx, "django.middleware.locale.LocaleMiddleware")
else:
MIDDLEWARE.insert(0, "django.middleware.locale.LocaleMiddleware")
LANGUAGE_CODE = "nl"
LANGUAGES = [
("nl", "Nederlands"),
("en", "English"),
("de", "Deutsch"),
("fr", "Français"),
("es", "Español"),
("it", "Italiano"),
("pt", "Português"),
("ru", "Русский"),
]
STATIC_ROOT = str(BASE_PATH / "static")
MEDIA_ROOT = str(BASE_PATH / "media")
PRIVATE_MEDIA_ROOT = str(BASE_PATH / "private")
DATABASES = {
"default": {
"ENGINE": "ocyan.i18n.db.sqlite3",
"NAME": str(BASE_PATH / "db.sqlite3"),
}
}
SECRET_KEY = "xyh998+wzhzueld8u6=)l@imh^!07&c6i_hjn7=8=jl$8%z_4t"
# Template engine vertical preset
ACTIVE_VERTICAL = "agency"
# Wagtail content internationalization in admin
WAGTAIL_I18N_ENABLED = True
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES
CONTENT_GUARD_STRICT = True
CONTENT_GUARD_BLOCK_MEDIUM = False
CONTENT_GUARD_LOCALES = [code for code, _label in LANGUAGES]
CONTENT_GUARD_REWRITE_ENABLED = True
CONTENT_GUARD_REWRITE_BACKEND = None
if "test" in sys.argv:
MIGRATION_MODULES = globals().get("MIGRATION_MODULES", {}).copy()
MIGRATION_MODULES["template_engine"] = (
"mandelstudio.test_migrations.template_engine"
)
TEST_RUNNER = "django.test.runner.DiscoverRunner"