source: mauRepo/dj_security/trunk/dj_security/urls.py @ 8741

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/dj_security/trunk/dj_security/urls.py@8741
Revision 8741, 5.3 KB checked in by mnagni, 7 years ago (diff)

Incomplete - # 22698: [CEDA Site Python Port] MyCEDA Login needs to be more user-friendly
 http://team.ceda.ac.uk/trac/ceda/ticket/22698

  • Property svn:mime-type set to text/plain
Line 
1from django.conf.urls import patterns, include, url
2from django.contrib import admin
3
4from mezzanine.core.views import direct_to_template
5from django.conf import settings
6from dj_security.views.dj_security_login import signin, CEDAAuthenticationForm,\
7    signin_success
8from django_authopenid import views as oid_views
9
10admin.autodiscover()
11
12# Uncomment the next two lines to enable the admin:
13# from django.contrib import admin
14# admin.autodiscover()
15
16urlpatterns = patterns('',
17    # Examples:
18    # url(r'^$', 'mydjango_secapp.views.home', name='home'),
19    # url(r'^mydjango_secapp/', include('mydjango_secapp.foo.urls')),
20
21    # Uncomment the admin/doc line below to enable admin documentation:
22    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
23
24    # Uncomment the next line to enable the admin:
25    # url(r'^admin/', include(admin.site.urls)),
26    #url(r'^accounts/', include('registration.backends.default.urls')),
27)
28
29urlpatterns += patterns('dj_security.views.dj_security_login',
30   (r'^account/register/$', 'logged_in'),   
31   ("^admin/", include(admin.site.urls)),
32   
33      # We don't want to presume how your homepage works, so here are a
34    # few patterns you can use to set it up.
35
36    # HOMEPAGE AS STATIC TEMPLATE
37    # ---------------------------
38    # This pattern simply loads the index.html template. It isn't
39    # commented out like the others, so it's the default. You only need
40    # one homepage pattern, so if you use a different one, comment this
41    # one out.
42
43    url("^$", direct_to_template, {"template": "index.html"}, name="home"),
44
45    # HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE
46    # ---------------------------------------------
47    # This pattern gives us a normal ``Page`` object, so that your
48    # homepage can be managed via the page tree in the admin. If you
49    # use this pattern, you'll need to create a page in the page tree,
50    # and specify its URL (in the Meta Data section) as "/", which
51    # is the value used below in the ``{"slug": "/"}`` part. Make
52    # sure to uncheck all templates for the "show in menus" field
53    # when you create the page, since the link to the homepage is
54    # always hard-coded into all the page menus that display navigation
55    # on the site. Also note that the normal rule of adding a custom
56    # template per page with the template name using the page's slug
57    # doesn't apply here, since we can't have a template called
58    # "/.html" - so for this case, the template "pages/index.html" can
59    # be used.
60
61    # url("^$", "mezzanine.pages.views.page", {"slug": "/"}, name="home"),
62
63    # HOMEPAGE FOR A BLOG-ONLY SITE
64    # -----------------------------
65    # This pattern points the homepage to the blog post listing page,
66    # and is useful for sites that are primarily blogs. If you use this
67    # pattern, you'll also need to set BLOG_SLUG = "" in your
68    # ``settings.py`` module, and delete the blog page object from the
69    # page tree in the admin if it was installed.
70
71    # url("^$", "mezzanine.blog.views.blog_post_list", name="home"),
72
73    # MEZZANINE'S URLS
74    # ----------------
75    # ADD YOUR OWN URLPATTERNS *ABOVE* THE LINE BELOW.
76    # ``mezzanine.urls`` INCLUDES A *CATCH ALL* PATTERN
77    # FOR PAGES, SO URLPATTERNS ADDED BELOW ``mezzanine.urls``
78    # WILL NEVER BE MATCHED!
79
80    # If you'd like more granular control over the patterns in
81    # ``mezzanine.urls``, go right ahead and take the parts you want
82    # from it, and use them directly below instead of using
83    # ``mezzanine.urls``.
84    #("^", include("mezzanine.urls")),
85
86    # MOUNTING MEZZANINE UNDER A PREFIX
87    # ---------------------------------
88    # You can also mount all of Mezzanine's urlpatterns under a
89    # URL prefix if desired. When doing this, you need to define the
90    # ``SITE_PREFIX`` setting, which will contain the prefix. Eg:
91    # SITE_PREFIX = "my/site/prefix"
92    # For convenience, and to avoid repeating the prefix, use the
93    # commented out pattern below (commenting out the one above of course)
94    # which will make use of the ``SITE_PREFIX`` setting. Make sure to
95    # add the import ``from django.conf import settings`` to the top
96    # of this file as well.
97    # Note that for any of the various homepage patterns above, you'll
98    # need to use the ``SITE_PREFIX`` setting as well.
99
100    ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls")),
101    url(r'^account/signin/$', signin, name='user_signin',
102        kwargs={'auth_form':CEDAAuthenticationForm,
103                'template_name': 'signin.html', 'redirect_field_name': 'r'}),
104    url(r'^account/signin/complete/$', oid_views.complete_signin, name='user_complete_signin',
105        kwargs={'on_success': signin_success, 'redirect_field_name': 'r'}),                       
106    #(r'^accounts/profile/$', 'logged_in'),
107    #(r'^locally_logged_in/$', 'locally_logged_in'),
108    url(r'^account/', include('django_authopenid.urls')),   
109
110)
111
112# Adds ``STATIC_URL`` to the context of error pages, so that error
113# pages can use JS, CSS and images.
114handler404 = "mezzanine.core.views.page_not_found"
115handler500 = "mezzanine.core.views.server_error"
116#urlpatterns += patterns('dj_security.views.dj_security_login',
117#    (r'^login$', 'login'),
118#)
119
120#url(r'^register/$', oid_views.register, name='user_register'),
121
122#urlpatterns += patterns('dj_security.views.my_profile',
123#    (r'^account/signin/$', 'frontpage'),
124#)
Note: See TracBrowser for help on using the repository browser.