comparison accounts/urls.py @ 1028:5ba2508939f7

Django 1.8 changes; first batch.
author Brian Neal <bgneal@gmail.com>
date Tue, 15 Dec 2015 21:01:07 -0600
parents be233ba7ca31
children e932f2ecd4a7
comparison
equal deleted inserted replaced
1027:cd4db27c90e3 1028:5ba2508939f7
1 """urls for the accounts application""" 1 """urls for the accounts application"""
2 from django.conf.urls import patterns, url 2 from django.conf.urls import url
3 from django.conf import settings 3 from django.conf import settings
4 import django.contrib.auth.views as auth_views
4 from django.views.generic import TemplateView 5 from django.views.generic import TemplateView
5 6
6 urlpatterns = patterns('accounts.views', 7 import accounts.views
7 url(r'^register/$', 'register', name='accounts-register'), 8
8 url(r'^register/1/$', 'register1', name='accounts-register1'), 9 urlpatterns = [
9 url(r'^register/2/$', 'register2', name='accounts-register2'), 10 url(r'^register/$', accounts.views.register, name='accounts-register'),
10 url(r'^register/code/$', 'get_code', name='accounts-code'), 11 url(r'^register/1/$', accounts.views.register1, name='accounts-register1'),
11 url(r'^register/thanks/$', 'register_thanks', name='accounts-register_thanks'), 12 url(r'^register/2/$', accounts.views.register2, name='accounts-register2'),
13 url(r'^register/code/$', accounts.views.get_code, name='accounts-code'),
14 url(r'^register/thanks/$', accounts.views.register_thanks, name='accounts-register_thanks'),
12 url(r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', 15 url(r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$',
13 'register_confirm', 16 accounts.views.register_confirm,
14 name='accounts-register_confirm'), 17 name='accounts-register_confirm'),
15 ) 18 ]
16 19
17 urlpatterns += patterns('', 20 urlpatterns += [
18 url(r'^login/$', 21 url(r'^login/$',
19 'django.contrib.auth.views.login', 22 auth_views.login,
20 kwargs={'template_name': 'accounts/login.html'}, 23 kwargs={'template_name': 'accounts/login.html'},
21 name='accounts-login'), 24 name='accounts-login'),
22 url(r'^logout/$', 25 url(r'^logout/$',
23 'django.contrib.auth.views.logout', 26 auth_views.logout,
24 kwargs={'template_name': 'accounts/logout.html'}, 27 kwargs={'template_name': 'accounts/logout.html'},
25 name='accounts-logout'), 28 name='accounts-logout'),
26 (r'^password/$', 29 url(r'^password/$',
27 'django.contrib.auth.views.password_change', 30 auth_views.password_change,
28 {'template_name': 'accounts/password_change.html', 31 {'template_name': 'accounts/password_change.html',
29 'post_change_redirect': settings.LOGIN_REDIRECT_URL}), 32 'post_change_redirect': settings.LOGIN_REDIRECT_URL}),
30 url(r'^password/reset/$', 33 url(r'^password/reset/$',
31 'django.contrib.auth.views.password_reset', 34 auth_views.password_reset,
32 kwargs={'template_name': 'accounts/password_reset.html', 35 kwargs={'template_name': 'accounts/password_reset.html',
33 'email_template_name': 'accounts/password_reset_email.txt', 36 'email_template_name': 'accounts/password_reset_email.txt',
34 'post_reset_redirect': '/accounts/password/reset/sent/'}, 37 'post_reset_redirect': '/accounts/password/reset/sent/'},
35 name='accounts-password_reset'), 38 name='accounts-password_reset'),
36 url(r'^password/reset/sent/$', 39 url(r'^password/reset/sent/$',
37 'django.contrib.auth.views.password_reset_done', 40 auth_views.password_reset_done,
38 kwargs={'template_name': 'accounts/password_reset_sent.html'}, 41 kwargs={'template_name': 'accounts/password_reset_sent.html'},
39 name='accounts-password_reset_sent'), 42 name='accounts-password_reset_sent'),
40 url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z]+-\w+)/$', 43 url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z]+-\w+)/$',
41 'django.contrib.auth.views.password_reset_confirm', 44 auth_views.password_reset_confirm,
42 kwargs={ 45 kwargs={
43 'template_name': 'accounts/password_reset_confirm.html', 46 'template_name': 'accounts/password_reset_confirm.html',
44 'post_reset_redirect': '/accounts/password/reset/success/', 47 'post_reset_redirect': '/accounts/password/reset/success/',
45 }, 48 },
46 name='accounts-password_reset_confirm'), 49 name='accounts-password_reset_confirm'),
47 url(r'^password/reset/success/$', 50 url(r'^password/reset/success/$',
48 'django.contrib.auth.views.password_reset_complete', 51 auth_views.password_reset_complete,
49 kwargs={'template_name': 'accounts/password_reset_complete.html'}, 52 kwargs={'template_name': 'accounts/password_reset_complete.html'},
50 name='accounts-password_reset_success'), 53 name='accounts-password_reset_success'),
51 url(r'^username/query/$', 54 url(r'^username/query/$',
52 'accounts.views.username_query', 55 accounts.views.username_query,
53 name='accounts-username_query'), 56 name='accounts-username_query'),
54 url(r'^username/sent/$', 57 url(r'^username/sent/$',
55 TemplateView.as_view(template_name='accounts/username_sent.html'), 58 TemplateView.as_view(template_name='accounts/username_sent.html'),
56 name='accounts-username_sent'), 59 name='accounts-username_sent'),
57 ) 60 ]
58