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
18 import portal.newsview
20 from portal.about import AboutView
21 from portal.registrationview import RegistrationView
22 from portal.accountview import AccountView, account_process
23 from portal.institution import InstitutionView
25 from portal.supportview import SupportView
26 from portal.contactview import ContactView
28 from portal.termsview import TermsView
30 home_view=portal.homeview.HomeView.as_view()
31 dashboard_view=portal.dashboardview.DashboardView.as_view()
32 platforms_view=portal.platformsview.PlatformsView.as_view()
34 #import portal.testbedlist
35 import portal.sliceview
36 import portal.sliceresourceview
38 import portal.slicetabexperiment
39 import portal.slicetabinfo
40 import portal.slicetabtestbeds
41 import portal.slicetabusers
42 import portal.slicetabmeasurements
44 import portal.managementtababout
45 import portal.managementtabrequests
47 #### high level choices
48 # main entry point (set to the / URL)
49 # beware that if this view is broken you end up in an endless cycle...
50 # maybe platforms_view would be best on the longer run
51 the_default_view=home_view
52 # where to be redirected after login
53 the_after_login_view=dashboard_view
54 # where to redirect when login is required
55 # might need another one ?
56 the_login_view=home_view
61 # url(r'^$', 'myslice.views.home', name='home'),
62 # url(r'^myslice/', include('myslice.foo.urls')),
63 # Uncomment the admin/doc line below to enable admin documentation:
64 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
65 # Uncomment the next line to enable the admin:
66 url(r'^admin/', include(admin.site.urls)),
69 (r'^/?$', the_default_view),
72 (r'^login-ok/?$', the_after_login_view, {'state': 'Welcome to MySlice'} ),
74 # seems to be what login_required uses to redirect ...
75 (r'^accounts/login/$', the_login_view),
76 (r'^login/?$', the_login_view),
77 (r'^logout/?$', 'auth.views.logout_user'),
80 (r'^manifold/proxy/(?P<format>\w+)/?$', 'manifoldapi.manifoldproxy.proxy'),
84 (r'^rest/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
85 (r'^table/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
86 (r'^datatable/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
87 (r'^update/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.update.dispatch'),
88 (r'^create/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.create.dispatch'),
89 (r'^delete/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.delete.dispatch'),
90 (r'^credentials/(?P<action>[^/]+)/?$', 'rest.credentials.dispatch'),
93 #(r'^monitor/sfa/getversion/?$', 'rest.monitor.sfaGetVersion'),
95 #(r'^view/?', include('view.urls')),
96 #(r'^list/slices', 'view.list.slices')
100 (r'^news/?$', portal.newsview.NewsView.as_view()),
101 (r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
102 (r'^users/(?P<slicename>[^/]+)/?$', portal.slicetabusers.SliceUserView.as_view()),
104 (r'^slice/(?P<slicename>[^/]+)/?$', portal.sliceview.SliceView.as_view()),
105 (r'^info/(?P<slicename>[^/]+)/?$', portal.slicetabinfo.SliceInfoView.as_view()),
106 (r'^testbeds/(?P<slicename>[^/]+)/?$', portal.slicetabtestbeds.SliceTabTestbeds.as_view()),
107 (r'^measurements/(?P<slicename>[^/]+)/?$', portal.slicetabmeasurements.SliceTabMeasurements.as_view()),
108 (r'^experiment/(?P<slicename>[^/]+)/?$', portal.slicetabexperiment.ExperimentView.as_view()),
110 url(r'^about/?$', AboutView.as_view(), name='about'),
112 url(r'^institution/?$', InstitutionView.as_view(), name='institution'),
113 (r'^management/requests/?$', portal.managementtabrequests.ManagementRequestsView.as_view()),
114 (r'^management/about/?$', portal.managementtababout.ManagementAboutView.as_view()),
116 url(r'^register/?$', RegistrationView.as_view(), name='registration'),
117 url(r'^account/?$', AccountView.as_view(), name='account'),
118 url(r'^account/account_process/?$', account_process),
119 url(r'^contact/?$', ContactView.as_view(), name='contact'),
120 url(r'^terms/?$', TermsView.as_view(), name='terms'),
121 url(r'^support/?$', SupportView.as_view(), name='support'),
123 url(r'^portal/', include('portal.urls')),
126 url(r'^sla/', include('sla.urls')),
129 #this one would not match the convention
130 # url(r'^debug/', include('debug_platform.urls')),
131 # but it was commented out anyways
132 for aux in auxiliaries:
133 if aux in INSTALLED_APPS:
134 urls.append ( url ( r'^%s/'%aux, include ('%s.urls'%aux )))
136 urlpatterns = patterns(*urls)