64197267f74db3fb9ade59ba7d5a35a7f09ab1b2
[myslice.git] / myslice / urls.py
1 from django.conf.urls import patterns, include, url
2 from django.conf      import settings
3
4 # Uncomment the next two lines to enable the admin:
5 # from django.contrib import admin
6 # admin.autodiscover()
7
8 # to enable insert_above stuff
9 from django.template.loader import add_to_builtins
10 add_to_builtins('insert_above.templatetags.insert_tags')
11
12 from settings import auxiliaries, INSTALLED_APPS
13
14 import portal.platformsview
15 import portal.dashboardview
16 import portal.homeview
17
18 home_view=portal.homeview.HomeView.as_view()
19 dashboard_view=portal.dashboardview.DashboardView.as_view()
20 platforms_view=portal.platformsview.PlatformsView.as_view()
21
22 #### high level choices
23 # main entry point (set to the / URL)
24 # beware that if this view is broken you end up in an endless cycle...
25 # maybe platforms_view would be best on the longer run
26 the_default_view=home_view
27 # where to be redirected after login
28 the_after_login_view=dashboard_view
29 # where to redirect when login is required
30 # might need another one ?
31 the_login_view=home_view
32
33 urls = [
34     '',
35     # Examples:
36     # url(r'^$', 'myslice.views.home', name='home'),
37     # url(r'^myslice/', include('myslice.foo.urls')),
38     # Uncomment the admin/doc line below to enable admin documentation:
39     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
40     # Uncomment the next line to enable the admin:
41     # url(r'^admin/', include(admin.site.urls)),
42     #
43     # default / view
44     (r'^/?$', the_default_view),
45     #
46     # login / logout
47     (r'^login-ok/?$', the_after_login_view, {'state': 'Welcome to MySlice'} ),
48     #
49     # seems to be what login_required uses to redirect ...
50     (r'^accounts/login/$', the_login_view),
51     (r'^login/?$', the_login_view),
52     (r'^logout/?$', 'auth.views.logout_user'),
53     #
54     # the manifold proxy
55     (r'^manifold/proxy/(?P<format>\w+)/?$', 'manifold.manifoldproxy.proxy'),
56     #
57     # Portal
58     url(r'^portal/', include('portal.urls')),
59 ]
60
61 #this one would not match the convention
62 # url(r'^debug/', include('debug_platform.urls')),
63 # but it was commented out anyways
64 for aux in auxiliaries:
65     if aux in INSTALLED_APPS:
66         urls.append ( url ( r'^%s/'%aux, include ('%s.urls'%aux )))
67
68 urlpatterns = patterns(*urls)