Gitlab CSE Unil

Commit 6a320cf0 authored by Julien Furrer's avatar Julien Furrer
Browse files

Updated urlpatterns for 1.8 compatibility

parent 7a50f341
# coding=utf-8
from __future__ import unicode_literals
from django.conf.urls import url, patterns, include
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework_nested import routers
from rest_framework import urls as rest_framework_urls
from adim.serializers import SharedAnObjSerializer
from adim.views import AnObjViewSet, SharedAnObjViewSet, AnnotationViewSet, SharedAnnotationViewSet, UserViewSet
......@@ -26,10 +27,10 @@ sh_annot_router.register(r'shared/annotations', SharedAnnotationViewSet, base_na
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
urlpatterns = patterns('',
urlpatterns = [
url(r'^$', d_router.get_api_root_view(), name='api-root'),
url(r'^', include(router.urls)),
url(r'^', include(annot_router.urls)),
url(r'^', include(sh_annot_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
)
\ No newline at end of file
url(r'^api-auth/', include(rest_framework_urls, namespace='rest_framework'))
]
\ No newline at end of file
......@@ -3,30 +3,29 @@ from __future__ import unicode_literals
from django.conf.urls import url, patterns, include
urlpatterns = patterns('adim_app.views',
url(r'^$', 'home', name="home"),
# url(r'^i/(?P<anobj_uuid>[0-9a-f]{32})/$', 'send_anobj_img', name='ao_image'),
# url(r'^t/(?P<anobj_uuid>[0-9a-f]{32})/$', 'send_anobj_thumb', name="ao_thumb"),
# url(r'^u/$', 'upload_thumb', name="upload-thumb"),
url(r'^new/$', 'upload_file', name='upload_file'),
from .views import home, upload_file, annotate_new, annotate, send_anobj_img, anobj_thumb, upload_anobj_thumb, \
suggest_users
urlpatterns = [
url(r'^$', home, name="home"),
url(r'^new/$', upload_file, name='upload_file'),
url(r'^annotate/',
include(patterns('adim_app.views',
url(r'^$', 'annotate_new', name="annotate-new"),
include(patterns('',
url(r'^$', annotate_new, name="annotate-new"),
url(r'^(?P<anobj_uuid>[0-9a-f]{6,32})/',
include(patterns('adim_app.views',
url(r'^$', 'annotate', name="annotate"),
url(r'^image/$', 'send_anobj_img', name='ao_image'),
url(r'^thumb/$', 'anobj_thumb', name="ao_thumb"),
url(r'^u/$', 'upload_anobj_thumb'),
include(patterns('',
url(r'^$', annotate, name="annotate"),
url(r'^image/$', send_anobj_img, name='ao_image'),
url(r'^thumb/$', anobj_thumb, name="ao_thumb"),
url(r'^u/$', upload_anobj_thumb),
))
),
)),
name="annotate_base"
),
url(r'^s/u/$', 'suggest_users', name='suggest-users'),
)
url(r'^s/u/$', suggest_users, name='suggest-users'),
]
# urlpatterns += patterns('adim_app.playground',
# url(r'^bh/$', 'bloodhound'),
......
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