Mercurial > public > sg101
diff 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 |
line wrap: on
line diff
--- a/accounts/urls.py Mon Dec 14 20:42:20 2015 -0600 +++ b/accounts/urls.py Tue Dec 15 21:01:07 2015 -0600 @@ -1,58 +1,60 @@ """urls for the accounts application""" -from django.conf.urls import patterns, url +from django.conf.urls import url from django.conf import settings +import django.contrib.auth.views as auth_views from django.views.generic import TemplateView -urlpatterns = patterns('accounts.views', - url(r'^register/$', 'register', name='accounts-register'), - url(r'^register/1/$', 'register1', name='accounts-register1'), - url(r'^register/2/$', 'register2', name='accounts-register2'), - url(r'^register/code/$', 'get_code', name='accounts-code'), - url(r'^register/thanks/$', 'register_thanks', name='accounts-register_thanks'), +import accounts.views + +urlpatterns = [ + url(r'^register/$', accounts.views.register, name='accounts-register'), + url(r'^register/1/$', accounts.views.register1, name='accounts-register1'), + url(r'^register/2/$', accounts.views.register2, name='accounts-register2'), + url(r'^register/code/$', accounts.views.get_code, name='accounts-code'), + url(r'^register/thanks/$', accounts.views.register_thanks, name='accounts-register_thanks'), url(r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', - 'register_confirm', + accounts.views.register_confirm, name='accounts-register_confirm'), -) +] -urlpatterns += patterns('', +urlpatterns += [ url(r'^login/$', - 'django.contrib.auth.views.login', + auth_views.login, kwargs={'template_name': 'accounts/login.html'}, name='accounts-login'), url(r'^logout/$', - 'django.contrib.auth.views.logout', + auth_views.logout, kwargs={'template_name': 'accounts/logout.html'}, name='accounts-logout'), - (r'^password/$', - 'django.contrib.auth.views.password_change', + url(r'^password/$', + auth_views.password_change, {'template_name': 'accounts/password_change.html', 'post_change_redirect': settings.LOGIN_REDIRECT_URL}), url(r'^password/reset/$', - 'django.contrib.auth.views.password_reset', + auth_views.password_reset, kwargs={'template_name': 'accounts/password_reset.html', 'email_template_name': 'accounts/password_reset_email.txt', 'post_reset_redirect': '/accounts/password/reset/sent/'}, name='accounts-password_reset'), url(r'^password/reset/sent/$', - 'django.contrib.auth.views.password_reset_done', + auth_views.password_reset_done, kwargs={'template_name': 'accounts/password_reset_sent.html'}, name='accounts-password_reset_sent'), url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z]+-\w+)/$', - 'django.contrib.auth.views.password_reset_confirm', + auth_views.password_reset_confirm, kwargs={ 'template_name': 'accounts/password_reset_confirm.html', 'post_reset_redirect': '/accounts/password/reset/success/', }, name='accounts-password_reset_confirm'), url(r'^password/reset/success/$', - 'django.contrib.auth.views.password_reset_complete', + auth_views.password_reset_complete, kwargs={'template_name': 'accounts/password_reset_complete.html'}, name='accounts-password_reset_success'), url(r'^username/query/$', - 'accounts.views.username_query', + accounts.views.username_query, name='accounts-username_query'), url(r'^username/sent/$', TemplateView.as_view(template_name='accounts/username_sent.html'), name='accounts-username_sent'), -) - +]