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

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