网上看到很多解决办法。但对于我来说,
好像加个post_change_redirect这个参数是最有效的。
from django.conf.urls import url
from . import views
from django.core.urlresolvers import reverse
urlpatterns = [
# post views
# url(r'^login/$', views.user_login, name='login'),
url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
url(r'^logout-then-login/$', 'django.contrib.auth.views.logout_then_login', name='logout_then_login'),
url(r'^password-change/$', 'django.contrib.auth.views.password_change',
{'post_change_redirect': '/account/password-change-done/', 'current_app': 'account'},
name='password_change'),
url(r'^password-change-done/$', 'django.contrib.auth.views.password_change_done',
name='password_change_done'),
url(r'^$', views.dashboard, name='dashboard'),
]