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
19 import portal.loginwidget
21 from portal.about import AboutView
22 from portal.registrationview import RegistrationView
23 from portal.accountview import AccountView, account_process
24 from portal.institution import InstitutionView
26 from portal.supportview import SupportView
27 from portal.contactview import ContactView
29 from portal.termsview import TermsView
31 home_view=portal.homeview.HomeView.as_view()
32 dashboard_view=portal.dashboardview.DashboardView.as_view()
33 platforms_view=portal.platformsview.PlatformsView.as_view()
35 #import portal.testbedlist
36 import portal.sliceview
37 import portal.sliceresourceview
39 import portal.slicetabexperiment
40 import portal.slicetabinfo
41 import portal.slicetabtestbeds
42 import portal.slicetabusers
43 import portal.slicetabmeasurements
45 import portal.managementtababout
46 import portal.managementtabrequests
50 #### high level choices
51 # main entry point (set to the / URL)
52 # beware that if this view is broken you end up in an endless cycle...
53 # maybe platforms_view would be best on the longer run
54 the_default_view=home_view
55 # where to be redirected after login
56 the_after_login_view=dashboard_view
57 # where to redirect when login is required
58 # might need another one ?
59 the_login_view=home_view
64 # url(r'^$', 'myslice.views.home', name='home'),
65 # url(r'^myslice/', include('myslice.foo.urls')),
66 # Uncomment the admin/doc line below to enable admin documentation:
67 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
68 # Uncomment the next line to enable the admin:
69 url(r'^admin/', include(admin.site.urls)),
72 (r'^/?$', the_default_view),
75 (r'^login-ok/?$', the_after_login_view, {'state': 'Welcome to MySlice'} ),
77 # seems to be what login_required uses to redirect ...
78 (r'^accounts/login/$', the_login_view),
79 (r'^login/?$', the_login_view),
80 (r'^logout/?$', 'auth.views.logout_user'),
83 (r'^manifold/proxy/(?P<format>\w+)/?$', 'manifoldapi.manifoldproxy.proxy'),
87 (r'^rest/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
88 (r'^sfa/(?P<method>[^/]+)/?$', 'rest.sfa_api.dispatch'),
89 (r'^table/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
90 (r'^datatable/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.get.dispatch'),
91 (r'^update/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.update.dispatch'),
92 (r'^create/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.create.dispatch'),
93 (r'^delete/(?P<object_type>[^/]+)/(?P<object_name>[^/]+)?/?$', 'rest.delete.dispatch'),
94 (r'^credentials/(?P<action>[^/]+)/?$', 'rest.credentials.dispatch'),
95 (r'^cache/(?P<action>[^/]+)/?$', 'rest.cache.dispatch'),
96 (r'^initscript/(?P<action>[^/]+)/?$', 'rest.initscript.dispatch'),
99 (r'^monitor/services/?$', 'rest.monitor.servicesStatus'),
101 #(r'^view/?', include('view.urls')),
102 #(r'^list/slices', 'view.list.slices')
104 # Login widget to be used in an iframe
105 (r'^loginwidget/?$', portal.loginwidget.LoginWidget.as_view()),
108 (r'^news/?$', portal.newsview.NewsView.as_view()),
109 (r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
110 (r'^users/(?P<slicename>[^/]+)/?$', portal.slicetabusers.SliceUserView.as_view()),
112 (r'^slice/(?P<slicename>[^/]+)/?$', portal.sliceview.SliceView.as_view()),
113 (r'^info/(?P<slicename>[^/]+)/?$', portal.slicetabinfo.SliceInfoView.as_view()),
114 (r'^testbeds/(?P<slicename>[^/]+)/?$', portal.slicetabtestbeds.SliceTabTestbeds.as_view()),
115 (r'^measurements/(?P<slicename>[^/]+)/?$', portal.slicetabmeasurements.SliceTabMeasurements.as_view()),
116 (r'^experiment/(?P<slicename>[^/]+)/?$', portal.slicetabexperiment.ExperimentView.as_view()),
117 (r'^studentslabs/(?P<slicename>[^/]+)/?$', forge.views.CreateCourseViev.as_view()),
119 url(r'^about/?$', AboutView.as_view(), name='about'),
121 url(r'^institution/?$', InstitutionView.as_view(), name='institution'),
122 (r'^management/requests/?$', portal.managementtabrequests.ManagementRequestsView.as_view()),
123 (r'^management/about/?$', portal.managementtababout.ManagementAboutView.as_view()),
125 url(r'^register/?$', RegistrationView.as_view(), name='registration'),
126 url(r'^account/?$', AccountView.as_view(), name='account'),
127 url(r'^account/account_process/?$', account_process),
128 url(r'^contact/?$', ContactView.as_view(), name='contact'),
129 url(r'^terms/?$', TermsView.as_view(), name='terms'),
130 url(r'^support/?$', SupportView.as_view(), name='support'),
132 url(r'^portal/', include('portal.urls')),
135 url(r'^sla/', include('sla.urls')),
138 #this one would not match the convention
139 # url(r'^debug/', include('debug_platform.urls')),
140 # but it was commented out anyways
141 for aux in auxiliaries:
142 if aux in INSTALLED_APPS:
143 urls.append ( url ( r'^%s/'%aux, include ('%s.urls'%aux )))
145 urlpatterns = patterns(*urls)