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