annotate accounts/urls.py @ 683:c83d330cb65f

For Django 1.5: LOGIN_* related settings take url names now.
author Brian Neal <bgneal@gmail.com>
date Fri, 23 Aug 2013 19:02:45 -0500
parents 8e6b8ffe5f34
children 4a49d4ac319f
rev   line source
gremmie@1 1 """urls for the accounts application"""
bgneal@574 2 from django.conf.urls import patterns, url
bgneal@76 3 from django.conf import settings
bgneal@659 4 from django.views.generic import TemplateView
gremmie@1 5
gremmie@1 6 urlpatterns = patterns('accounts.views',
bgneal@500 7 url(r'^login/ajax/$', 'login_ajax', name='accounts-login_ajax'),
gremmie@1 8 url(r'^register/$', 'register', name='accounts-register'),
gremmie@1 9 (r'^register/thanks/$', 'register_thanks'),
bgneal@289 10 (r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', 'register_confirm'),
gremmie@1 11 )
gremmie@1 12
gremmie@1 13 urlpatterns += patterns('',
bgneal@78 14 url(r'^login/$',
gremmie@1 15 'django.contrib.auth.views.login',
gremmie@1 16 kwargs={'template_name': 'accounts/login.html'},
gremmie@1 17 name='accounts-login'),
bgneal@78 18 url(r'^logout/$',
gremmie@1 19 'django.contrib.auth.views.logout',
gremmie@1 20 kwargs={'template_name': 'accounts/logout.html'},
bgneal@289 21 name='accounts-logout'),
bgneal@289 22 (r'^password/$',
bgneal@289 23 'django.contrib.auth.views.password_change',
gremmie@1 24 {'template_name': 'accounts/password_change.html',
bgneal@76 25 'post_change_redirect': settings.LOGIN_REDIRECT_URL}),
bgneal@289 26 url(r'^password/reset/$',
bgneal@289 27 'django.contrib.auth.views.password_reset',
bgneal@78 28 kwargs={'template_name': 'accounts/password_reset.html',
bgneal@78 29 'email_template_name': 'accounts/password_reset_email.txt',
bgneal@78 30 'post_reset_redirect': '/accounts/password/reset/sent/'},
bgneal@78 31 name='accounts-password_reset'),
bgneal@78 32 url(r'^password/reset/sent/$',
bgneal@78 33 'django.contrib.auth.views.password_reset_done',
bgneal@78 34 kwargs={'template_name': 'accounts/password_reset_sent.html'},
bgneal@78 35 name='accounts-password_reset_sent'),
bgneal@78 36 url(r'^password/reset/confirm/(?P<uidb36>[0-9a-z]+)/(?P<token>[0-9a-z]+-\w+)/$',
bgneal@78 37 'django.contrib.auth.views.password_reset_confirm',
bgneal@78 38 kwargs={
bgneal@78 39 'template_name': 'accounts/password_reset_confirm.html',
bgneal@78 40 'post_reset_redirect': '/accounts/password/reset/success/',
bgneal@78 41 },
bgneal@78 42 name='accounts-password_reset_confirm'),
bgneal@78 43 url(r'^password/reset/success/$',
bgneal@78 44 'django.contrib.auth.views.password_reset_complete',
bgneal@78 45 kwargs={'template_name': 'accounts/password_reset_complete.html'},
bgneal@78 46 name='accounts-password_reset_success'),
bgneal@659 47 url(r'^username/query/$',
bgneal@659 48 'accounts.views.username_query',
bgneal@659 49 name='accounts-username_query'),
bgneal@659 50 url(r'^username/sent/$',
bgneal@659 51 TemplateView.as_view(template_name='accounts/username_sent.html'),
bgneal@659 52 name='accounts-username_sent'),
gremmie@1 53 )
gremmie@1 54