0.2.3.3
- Fix admin
This commit is contained in:
parent
86ced1a62b
commit
061a2e852d
3 changed files with 3 additions and 34 deletions
|
|
@ -22,6 +22,7 @@ INSTALLED_APPS = [
|
|||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"django.forms",
|
||||
# third party apps
|
||||
"rest_framework",
|
||||
"drf_yasg",
|
||||
|
|
@ -55,6 +56,8 @@ MIDDLEWARE = [
|
|||
|
||||
ROOT_URLCONF = "newsreader.urls"
|
||||
|
||||
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
|
|
@ -71,8 +74,6 @@ TEMPLATES = [
|
|||
}
|
||||
]
|
||||
|
||||
FORM_RENDERER = "newsreader.utils.form.FormRenderer"
|
||||
|
||||
WSGI_APPLICATION = "newsreader.wsgi.application"
|
||||
|
||||
# Database
|
||||
|
|
|
|||
|
|
@ -9,22 +9,6 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
|||
|
||||
INSTALLED_APPS += ["debug_toolbar", "django_extensions"]
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [os.path.join(DJANGO_PROJECT_DIR, "templates")],
|
||||
"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",
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
# Third party settings
|
||||
AXES_FAILURE_LIMIT = 50
|
||||
AXES_COOLOFF_TIME = None
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
from django.forms.renderers import DjangoTemplates
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.template.loader import get_template
|
||||
|
||||
|
||||
class FormRenderer(DjangoTemplates):
|
||||
"""
|
||||
Prioritizes templates from TEMPLATES setting and fall's back to django's
|
||||
default FormRenderer behaviour
|
||||
"""
|
||||
|
||||
def get_template(self, template_name):
|
||||
try:
|
||||
return get_template(template_name)
|
||||
except TemplateDoesNotExist:
|
||||
return super().get_template(template_name)
|
||||
Loading…
Add table
Add a link
Reference in a new issue