tango with django ch12

User Authentication

install Django-Registration-Redux

sudo pip install django-registration-redux

修改installed_apps

INSTALLED_APPS = (
   ...
   'registration',
   )

config urls.py

url(r'^accounts/',include('registration.backends.simple.urls'))

write template

# 在templates下新建registration文件夾
# 在registration中新建login, logout, registration_form.html,
# registration_complete.html, password_change.html,password_change_done.html
 文件名和url對應,
^accounts/ ^password/change/$ [name='auth_password_change']對應password_change.html
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章