aboutsummaryrefslogtreecommitdiffstats
path: root/account/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'account/urls.py')
-rw-r--r--account/urls.py58
1 files changed, 35 insertions, 23 deletions
diff --git a/account/urls.py b/account/urls.py
index 671ac9a..b61e0e2 100644
--- a/account/urls.py
+++ b/account/urls.py
@@ -12,10 +12,45 @@ from django.contrib.auth.decorators import login_required
from registration.backends.default.views import ActivationView
from registration.backends.default.views import RegistrationView
+from account.views import ProfileView, UpdateProfileView
from account.forms import UserRegForm
urlpatterns = patterns('',
+ ## profile
+ url(r'^profile/$',
+ login_required(ProfileView.as_view()),
+ name='profile'),
+ # update profile
+ url(r'^profile/update/$',
+ login_required(UpdateProfileView.as_view()),
+ name='profile_update'),
+ # update profile done
+ url(r'^profile/update/done/$',
+ login_required(TemplateView.as_view(template_name='account/profile_update_done.html')),
+ name='profile_update_done'),
+ ## django auth views
+ # login
+ url(r'^login/$', 'django.contrib.auth.views.login',
+ {'template_name': 'account/login.html'},
+ name='login'),
+ # logout
+ url(r'^logout/$', 'django.contrib.auth.views.logout',
+ {'template_name': 'account/logout.html'},
+ name='logout'),
+ # change password
+ # If 'post_change_redirect' not provided,
+ # then redirect to url 'password_change_done'.
+ url(r'^password/change/$', 'django.contrib.auth.views.password_change',
+ {'template_name': 'account/password_change.html'},
+ name='password_change'),
+ # change password done
+ url(r'^password/change/done$', 'django.contrib.auth.views.password_change_done',
+ {'template_name': 'account/password_change_done.html'},
+ name='password_change_done'),
+)
+
+urlpatterns += patterns('',
## django-registration
# 0. registration_disallowed
url(r'^register/closed/$',
@@ -41,29 +76,6 @@ urlpatterns = patterns('',
url(r'^activate/(?P<activation_key>\w+)/$',
ActivationView.as_view(),
name='registration_activate'),
- ## profile
- url(r'^profile/$',
- login_required(TemplateView.as_view(template_name='account/profile.html')),
- name='profile'),
- ## django auth views
- # login
- url(r'^login/$', 'django.contrib.auth.views.login',
- {'template_name': 'account/login.html'},
- name='login'),
- # logout
- url(r'^logout/$', 'django.contrib.auth.views.logout',
- {'template_name': 'account/logout.html'},
- name='logout'),
- # change password
- # If 'post_change_redirect' not provided,
- # then redirect to url 'password_change_done'.
- url(r'^password/change/$', 'django.contrib.auth.views.password_change',
- {'template_name': 'account/password_change.html'},
- name='password_change'),
- # change password done
- url(r'^password/change/done$', 'django.contrib.auth.views.password_change_done',
- {'template_name': 'account/password_change_done.html'},
- name='password_change_done'),
)