mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
Update template configuration for newer django
Also fully backwards compatible
This commit is contained in:
@ -50,13 +50,6 @@ STATICFILES_DIRS = (
|
|||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
|
SECRET_KEY = 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
|
||||||
|
|
||||||
# List of callables that know how to import templates from various sources.
|
|
||||||
TEMPLATE_LOADERS = (
|
|
||||||
'django.template.loaders.filesystem.Loader',
|
|
||||||
'django.template.loaders.app_directories.Loader',
|
|
||||||
# 'django.template.loaders.eggs.load_template_source',
|
|
||||||
)
|
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = [
|
MIDDLEWARE_CLASSES = [
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
@ -70,17 +63,19 @@ CSRF_FAILURE_VIEW='pgweb.core.views.csrf_failure'
|
|||||||
|
|
||||||
ROOT_URLCONF = 'pgweb.urls'
|
ROOT_URLCONF = 'pgweb.urls'
|
||||||
|
|
||||||
TEMPLATE_DIRS = (
|
TEMPLATES = [{
|
||||||
'templates/',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'../templates', # Sometimes called in subdirectories, should never hurt to have both
|
'DIRS': ['templates', ],
|
||||||
)
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
'context_processors': [
|
||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'django.core.context_processors.media',
|
'django.core.context_processors.media',
|
||||||
'pgweb.util.contexts.PGWebContextProcessor',
|
'pgweb.util.contexts.PGWebContextProcessor',
|
||||||
)
|
],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
LOGIN_URL='/account/login/'
|
LOGIN_URL='/account/login/'
|
||||||
LOGIN_REDIRECT_URL='/account/'
|
LOGIN_REDIRECT_URL='/account/'
|
||||||
|
Reference in New Issue
Block a user