mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
Update exampleapp to use new routing/templates settings
The exampleapp is still running deprecated code.
This commit is contained in:
parent
c8a2586892
commit
006ecf1dff
2 changed files with 21 additions and 6 deletions
|
|
@ -28,6 +28,7 @@ MIDDLEWARE = (
|
|||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"defender.middleware.FailedLoginMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware"
|
||||
)
|
||||
|
||||
ROOT_URLCONF = "exampleapp.urls"
|
||||
|
|
@ -80,3 +81,18 @@ app.config_from_object("django.conf:settings")
|
|||
app.autodiscover_tasks(lambda: INSTALLED_APPS)
|
||||
|
||||
DEBUG = True
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"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",
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from django.conf.urls import patterns, include
|
||||
from django.urls import include, re_path
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
|
|
@ -6,11 +6,10 @@ from django.conf.urls.static import static
|
|||
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns(
|
||||
"",
|
||||
(r"^admin/", include(admin.site.urls)),
|
||||
(r"^admin/defender/", include("defender.urls")),
|
||||
)
|
||||
urlpatterns = [
|
||||
re_path(r"^admin/", admin.site.urls),
|
||||
re_path(r"^admin/defender/", include("defender.urls")),
|
||||
]
|
||||
|
||||
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
|
|
|||
Loading…
Reference in a new issue