Django-admin忘了密码

时间:2017-09-29 07:53:38

标签: django django-models django-forms django-views django-admin

的login.html

   {% url 'password_reset' as password_reset_url %}
  <div class="password-reset-link">
    <a href="{{ password_reset_url }}">{% trans 'Şifremi Unuttum ?' %}</a>
  </div>

urls.py

from django.conf.urls import url
from . import views
from django.contrib.auth import views as auth_views

app_name = 'Web'

urlpatterns = [
    url(r'^password_reset/$', auth_views.password_reset, name='password_reset'),
url(r'^password_reset/done/$', auth_views.password_reset_done, name='password_reset_done'),
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
    auth_views.password_reset_confirm, name='password_reset_confirm'),
url(r'^reset/done/$', auth_views.password_reset_complete, name='password_reset_complete'),

    ]

你可以看到包括pasword_reset_url但是我无法在登录页面看到这个href如何配置?

1 个答案:

答案 0 :(得分:0)

看到你的import { routing } from './app-routing.module'; //and then write within imports @NgModule({ declarations: [ AppComponent, NavbarComponent ], imports: [ BrowserModule, **routing**, EmployeeModule ], 没有urls.py。所以写一下:

admin_reset_password