Tuesday, June 01, 2010

Modular Django Admin Part 3

Django Auth has a lot of stuff built in http://docs.djangoproject.com/en/dev/topics/auth/

A list of all the default templates and urls you need for login password reset and password change. Most of these templates are in django/contrib/admin/templates/registration

url(r'^accounts/login/$', 'django.contrib.auth.views.login',name='login'),
url(r'^accounts/$', 'django.contrib.auth.views.login',name='login'),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout',{'next_page': '/'},name='logout'),
url(r'^accounts/password_change/$', 'django.contrib.auth.views.password_change',name='password_change'),
url(r'^accounts/password_change_done/$', 'django.contrib.auth.views.password_change_done',name='password_change_done'),
url(r'^accounts/password_reset/$', 'django.contrib.auth.views.password_reset',name='password_reset'),
url(r'^accounts/accounts/password_reset/done/$', 'django.contrib.auth.views.password_reset_done',name='password_reset_done'),
url(r'^accounts/reset/(?P[0-9A-Za-z]+)-(?P.+)/$', 'django.contrib.auth.views.password_reset_confirm',name='password_reset_confirm'),
url(r'^accounts/reset/done/$', 'django.contrib.auth.views.password_reset_complete',name='password_reset_complete'),

template/registration/login.html (django/contrib/admin/templates/admin/login.html)
template/registration/logged_out.html
template/registration/password_change_form.html
template/registration/password_change_done.html
template/registration/password_reset_email.html
template/registration/password_reset_done.html
template/registration/password_reset_confirm.html
template/registration/password_reset_complete.html

So now we can login see generic view lists of our models, not we need to edit them.