Commit c312d7d8 authored by Stauros Kroustouris's avatar Stauros Kroustouris

clean urls

parent d2b99583
......@@ -4,28 +4,9 @@ from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from rest_framework import routers
from flowspec.viewsets import (
MatchProtocolViewSet,
RouteViewSet,
PortViewSet,
FragmentTypeViewSet,
ThenActionViewSet
)
from accounts.viewsets import UserViewSet
# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'users', UserViewSet)
router.register(r'routes', RouteViewSet)
router.register(r'ports', PortViewSet)
router.register(r'fragmenttypes', FragmentTypeViewSet)
router.register(r'matchprotocols', MatchProtocolViewSet)
router.register(r'then_action', ThenActionViewSet)
urlpatterns = patterns('',
urlpatterns = patterns(
'',
(r'^poll/', include('poller.urls')),
url(r'^/?$', 'flowspec.views.group_routes', name="group-routes"),
url(r'^routes_ajax/?$', 'flowspec.views.group_routes_ajax', name="group-routes-ajax"),
......@@ -33,7 +14,6 @@ urlpatterns = patterns('',
url(r'^dashboard/?$', 'flowspec.views.dashboard', name="dashboard"),
url(r'^profile/?$', 'flowspec.views.user_profile', name="user-profile"),
url(r'^add/?$', 'flowspec.views.add_route', name="add-route"),
#url(r'^addrl/?$', 'flowspec.views.add_rate_limit', name="add-rate-limit"),
url(r'^addport/?$', 'flowspec.views.add_port', name="add-port"),
url(r'^edit/(?P<route_slug>[\w\-]+)/$', 'flowspec.views.edit_route', name="edit-route"),
url(r'^delete/(?P<route_slug>[\w\-]+)/$', 'flowspec.views.delete_route', name="delete-route"),
......@@ -41,30 +21,21 @@ urlpatterns = patterns('',
url(r'^welcome/?', 'flowspec.views.welcome', name="welcome"),
url(r'^logout/?', 'flowspec.views.user_logout', name="logout"),
(r'^setlang/?$', 'django.views.i18n.set_language'),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^load_js/(?P<file>[\w\s\d_-]+)/$', 'flowspec.views.load_jscript', name="load-js"),
url(r'^selectinst/?$', 'flowspec.views.selectinst', name="selectinst"),
url(r'^accounts/activate/(?P<activation_key>\w+)/$', 'accounts.views.activate', name='activate_account'),
url(r'^activate/complete/$',
direct_to_template,
{ 'template': 'registration/activation_complete.html' },
name='registration_activation_complete'),
# Uncomment the next line to enable the admin:
url(r'^load_js/(?P<file>[\w\s\d_-]+)/$', 'flowspec.views.load_jscript', name="load-js"),
url(
r'^activate/complete/$',
direct_to_template,
{'template': 'registration/activation_complete.html'},
name='registration_activation_complete'
),
(r'^admin/', include(admin.site.urls)),
(r'^tinymce/', include('tinymce.urls')),
url(r'^altlogin/?', 'django.contrib.auth.views.login', {'template_name': 'overview/login.html'}, name="altlogin"),
url(
r'^altlogin/?',
'django.contrib.auth.views.login',
{'template_name': 'overview/login.html'}, name="altlogin"
),
url(r'^overview/?$', 'flowspec.views.overview', name="overview"),
url(r'^api/v1/', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
)
# if settings.DEBUG:
# urlpatterns += patterns('',
# (r'^static/(?P<path>.*)', 'django.views.static.serve',\
# {'document_root': settings.STATIC_URL}),
# )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment