原生django-allauth里面的urls
urlpatterns
= [
path
("signup/", views
.signup
, name
="account_signup"),
path
("login/", views
.login
, name
="account_login"),
path
("logout/", views
.logout
, name
="account_logout"),
path
("password/change/", views
.password_change
,
name
="account_change_password"),
path
("password/set/", views
.password_set
, name
="account_set_password"),
path
("inactive/", views
.account_inactive
, name
="account_inactive"),
path
("email/", views
.email
, name
="account_email"),
path
("confirm-email/", views
.email_verification_sent
,
name
="account_email_verification_sent"),
re_path
(r
"^confirm-email/(?P<key>[-:\w]+)/$", views
.confirm_email
,
name
="account_confirm_email"),
path
("password/reset/", views
.password_reset
,
name
="account_reset_password"),
path
("password/reset/done/", views
.password_reset_done
,
name
="account_reset_password_done"),
re_path
(r
"^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$",
views
.password_reset_from_key
,
name
="account_reset_password_from_key"),
path
("password/reset/key/done/", views
.password_reset_from_key_done
,
name
="account_reset_password_from_key_done"),
]
文件所在目录: C:\Users\93623.PyCharm2019.2\system\remote_sources\220168029\383581205\allauth\account\urls.py
可以在templates里html文件中书写如下代码:
<a href="{% url 'account_logout' %}">注销</a>