aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBeth Flanagan <elizabeth.flanagan@intel.com>2015-01-13 11:47:40 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2015-01-14 11:34:11 +0000
commit45872abd28e22d20226c3b4e2d832634282883ad (patch)
tree2ed33a3335562b77e5cc8db9e5bf10fe5b34eb90
parentd3a2dd6f73ceaeeda06902d18fd5bd09fae2751a (diff)
downloadbuildhistory-web-45872abd28e22d20226c3b4e2d832634282883ad.tar.gz
buildhistory-web-45872abd28e22d20226c3b4e2d832634282883ad.tar.bz2
buildhistory-web-45872abd28e22d20226c3b4e2d832634282883ad.zip
urls.py: Fix for broken django-registration and 1.6 upgrade.
Some explaination on why this is done is here: http://stackoverflow.com/questions/19985103/django-1-6-and-django-registration-built-in-authentication-views-not-picked-up Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
-rw-r--r--urls.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/urls.py b/urls.py
index 94e48ee..335770c 100644
--- a/urls.py
+++ b/urls.py
@@ -5,16 +5,38 @@
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
-from django.conf.urls.defaults import patterns, include, url
-from django.views.generic.simple import redirect_to
+from django.conf.urls import patterns, include, url
+from django.views.generic import RedirectView
+from django.contrib.auth import views as auth_views
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^warningmgr/', include('warningmgr.urls')),
- url(r'^admin/', include(admin.site.urls)),
+ #override the default urls
+ url(r'^password/change/$',
+ auth_views.password_change,
+ name='password_change'),
+ url(r'^password/change/done/$',
+ auth_views.password_change_done,
+ name='password_change_done'),
+ url(r'^password/reset/$',
+ auth_views.password_reset,
+ name='password_reset'),
+ url(r'^password/reset/done/$',
+ auth_views.password_reset_done,
+ name='password_reset_done'),
+ url(r'^password/reset/complete/$',
+ auth_views.password_reset_complete,
+ name='password_reset_complete'),
+ url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
+ auth_views.password_reset_confirm,
+ name='password_reset_confirm'),
+
+ #and now add the registration urls
url(r'^accounts/', include('registration.backends.default.urls')),
- url(r'.*', redirect_to, {'url' : '/warningmgr/'})
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'.*', RedirectView.as_view(url='/warningmgr/'))
)