Statistics
| Branch: | Tag: | Revision:

root / flowspy / urls.py.dist @ 243819e7

History | View | Annotate | Download (3.1 kB)

1 70082f92 Leonidas Poulopoulos
from django.conf.urls import patterns, include, url
2 70082f92 Leonidas Poulopoulos
from django.views.generic.simple import direct_to_template
3 70082f92 Leonidas Poulopoulos
# Uncomment the next two lines to enable the admin:
4 70082f92 Leonidas Poulopoulos
from django.contrib import admin
5 70082f92 Leonidas Poulopoulos
admin.autodiscover()
6 70082f92 Leonidas Poulopoulos
7 243819e7 Stauros Kroustouris
from rest_framework import routers
8 243819e7 Stauros Kroustouris
from flowspec.viewsets import (
9 243819e7 Stauros Kroustouris
    MatchProtocolViewSet,
10 243819e7 Stauros Kroustouris
    RouteViewSet,
11 243819e7 Stauros Kroustouris
    PortViewSet,
12 243819e7 Stauros Kroustouris
    FragmentTypeViewSet,
13 243819e7 Stauros Kroustouris
    ThenActionViewSet
14 243819e7 Stauros Kroustouris
)
15 243819e7 Stauros Kroustouris
16 243819e7 Stauros Kroustouris
from accounts.viewsets import UserViewSet
17 243819e7 Stauros Kroustouris
18 243819e7 Stauros Kroustouris
19 243819e7 Stauros Kroustouris
# Routers provide an easy way of automatically determining the URL conf.
20 243819e7 Stauros Kroustouris
router = routers.DefaultRouter()
21 243819e7 Stauros Kroustouris
router.register(r'users', UserViewSet)
22 243819e7 Stauros Kroustouris
router.register(r'routes', RouteViewSet)
23 243819e7 Stauros Kroustouris
router.register(r'ports', PortViewSet)
24 243819e7 Stauros Kroustouris
router.register(r'fragmenttypes', FragmentTypeViewSet)
25 243819e7 Stauros Kroustouris
router.register(r'matchprotocols', MatchProtocolViewSet)
26 243819e7 Stauros Kroustouris
router.register(r'then_action', ThenActionViewSet)
27 243819e7 Stauros Kroustouris
28 70082f92 Leonidas Poulopoulos
urlpatterns = patterns('',
29 70082f92 Leonidas Poulopoulos
    (r'^poll/', include('poller.urls')),
30 70082f92 Leonidas Poulopoulos
    url(r'^/?$', 'flowspec.views.group_routes', name="group-routes"),
31 1b39b805 Leonidas Poulopoulos
    url(r'^routes_ajax/?$', 'flowspec.views.group_routes_ajax', name="group-routes-ajax"),
32 1b39b805 Leonidas Poulopoulos
    url(r'^overview_ajax/?$', 'flowspec.views.overview_routes_ajax', name="overview-ajax"),
33 1b39b805 Leonidas Poulopoulos
    url(r'^dashboard/?$', 'flowspec.views.dashboard', name="dashboard"),
34 70082f92 Leonidas Poulopoulos
    url(r'^profile/?$', 'flowspec.views.user_profile', name="user-profile"),
35 70082f92 Leonidas Poulopoulos
    url(r'^add/?$', 'flowspec.views.add_route', name="add-route"),
36 70082f92 Leonidas Poulopoulos
    #url(r'^addrl/?$', 'flowspec.views.add_rate_limit', name="add-rate-limit"),
37 70082f92 Leonidas Poulopoulos
    url(r'^addport/?$', 'flowspec.views.add_port', name="add-port"),
38 70082f92 Leonidas Poulopoulos
    url(r'^edit/(?P<route_slug>[\w\-]+)/$', 'flowspec.views.edit_route', name="edit-route"),
39 70082f92 Leonidas Poulopoulos
    url(r'^delete/(?P<route_slug>[\w\-]+)/$', 'flowspec.views.delete_route', name="delete-route"),
40 70082f92 Leonidas Poulopoulos
    url(r'^login/?', 'flowspec.views.user_login', name="login"),
41 70082f92 Leonidas Poulopoulos
    url(r'^welcome/?', 'flowspec.views.welcome', name="welcome"),
42 70082f92 Leonidas Poulopoulos
    url(r'^logout/?', 'flowspec.views.user_logout', name="logout"),
43 70082f92 Leonidas Poulopoulos
    (r'^setlang/?$', 'django.views.i18n.set_language'),
44 70082f92 Leonidas Poulopoulos
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
45 243819e7 Stauros Kroustouris
    url(r'^load_js/(?P<file>[\w\s\d_-]+)/$', 'flowspec.views.load_jscript', name="load-js"),
46 243819e7 Stauros Kroustouris
    url(r'^selectinst/?$', 'flowspec.views.selectinst', name="selectinst"),
47 70082f92 Leonidas Poulopoulos
    url(r'^accounts/activate/(?P<activation_key>\w+)/$', 'accounts.views.activate', name='activate_account'),
48 70082f92 Leonidas Poulopoulos
    url(r'^activate/complete/$',
49 70082f92 Leonidas Poulopoulos
                           direct_to_template,
50 70082f92 Leonidas Poulopoulos
                           { 'template': 'registration/activation_complete.html' },
51 70082f92 Leonidas Poulopoulos
                           name='registration_activation_complete'),
52 70082f92 Leonidas Poulopoulos
53 70082f92 Leonidas Poulopoulos
    # Uncomment the next line to enable the admin:
54 70082f92 Leonidas Poulopoulos
    (r'^admin/', include(admin.site.urls)),
55 243819e7 Stauros Kroustouris
    (r'^tinymce/', include('tinymce.urls')),
56 243819e7 Stauros Kroustouris
57 243819e7 Stauros Kroustouris
58 70082f92 Leonidas Poulopoulos
    url(r'^altlogin/?', 'django.contrib.auth.views.login', {'template_name': 'overview/login.html'}, name="altlogin"),
59 70082f92 Leonidas Poulopoulos
    url(r'^overview/?$', 'flowspec.views.overview', name="overview"),
60 243819e7 Stauros Kroustouris
61 243819e7 Stauros Kroustouris
    url(r'^api/v1/', include(router.urls)),
62 243819e7 Stauros Kroustouris
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
63 70082f92 Leonidas Poulopoulos
)
64 70082f92 Leonidas Poulopoulos
65 70082f92 Leonidas Poulopoulos
66 70082f92 Leonidas Poulopoulos
# if settings.DEBUG:
67 70082f92 Leonidas Poulopoulos
#     urlpatterns += patterns('',
68 70082f92 Leonidas Poulopoulos
#         (r'^static/(?P<path>.*)', 'django.views.static.serve',\
69 70082f92 Leonidas Poulopoulos
#             {'document_root':  settings.STATIC_URL}),
70 70082f92 Leonidas Poulopoulos
#     )