Move TEMPLATES, AUTHENTICATION_BACKENDS and MIDDLEWARE into base settings

These don't change, so belong in the base settings.
This commit is contained in:
Ben Sturmfels 2023-10-05 17:35:18 +11:00
parent fb9e7242b5
commit 6b95646cc7
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -100,3 +100,39 @@ INSTALLED_APPS = [
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
_conservancy_root_dir = Path(__file__).resolve().parent / 'conservancy'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
_conservancy_root_dir / 'templates',
_conservancy_root_dir / 'static',
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'conservancy.local_context_processors.host_url',
'conservancy.local_context_processors.sitefundraiser',
]
}
}
]
AUTHENTICATION_BACKENDS = (
# 'conservancy.auth.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'conservancy.middleware.ForceCanonicalHostnameMiddleware',
# 'django.middleware.doc.XViewMiddleware',
]