generated from westfarn/web_django_template
Initial commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""Development settings."""
|
||||
|
||||
from .base import * # noqa: F403
|
||||
from .logging import build_logging_config, logging_level_for_env
|
||||
|
||||
DEBUG = True
|
||||
|
||||
SITE_UNDER_CONSTRUCTION = env_bool("SITE_UNDER_CONSTRUCTION", False) # noqa: F405
|
||||
TIANJI_ENABLED = env_bool("TIANJI_ENABLED", False) # noqa: F405
|
||||
|
||||
STORAGES = {
|
||||
"default": {
|
||||
"BACKEND": "django.core.files.storage.memory.InMemoryStorage",
|
||||
},
|
||||
"staticfiles": {
|
||||
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
|
||||
},
|
||||
}
|
||||
|
||||
EMAIL_BACKEND = env( # noqa: F405
|
||||
"EMAIL_BACKEND",
|
||||
"django.core.mail.backends.console.EmailBackend",
|
||||
)
|
||||
|
||||
# ALLOWED_HOSTS default "*" → empty CSRF_TRUSTED_ORIGINS, which breaks browser
|
||||
# Origin checks on POST. Always trust local runserver origins in dev.
|
||||
_local_csrf = [
|
||||
"http://127.0.0.1:8000",
|
||||
"http://localhost:8000",
|
||||
"http://0.0.0.0:8000",
|
||||
"http://127.0.0.1:8001",
|
||||
"http://localhost:8001",
|
||||
]
|
||||
CSRF_TRUSTED_ORIGINS = list(
|
||||
dict.fromkeys([*_local_csrf, *CSRF_TRUSTED_ORIGINS]) # noqa: F405
|
||||
)
|
||||
|
||||
LOGGING = build_logging_config(logging_level_for_env("dev"), "dev")
|
||||
Reference in New Issue
Block a user