我使用了自定义password_reset_form.html
(我的路径:/templates/registration/password_reset_form.html)
但是Django采用了Django-Default-Password-Reset-View
任何解决方案我能做什么?
urls.py
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import AuthenticationForm
from django.template import RequestContext
from django.urls import include, path, re_path
from myapp.CustomForms.appforms import LoginAuthenticationForm
from django.contrib.auth.views import LogoutView
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from myapp.views import (
...
)
from . import views
urlpatterns = [
...
url(r"^$", views.startseite, name="home"),
url(r"^signup/$", views.signup, name="signup"),
url(
r"^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z].
{1,13}-[0-9A-Za-z]{1,20})/",
views.activate, name="activate",),
url('^', include('django.contrib.auth.urls')),
]
settings.py
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.auth',
'myapp',
]
...
答案 0 :(得分:0)
django不选择我的自定义模板的原因是我必须更改我的顺序
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
'django.contrib.admin',
'django.contrib.auth',
]
myapp必须在django.contrib.admin和django.contrib.auth之前设置