2016-09-29 20:20:10 +00:00
|
|
|
"""spejstore URL Configuration
|
|
|
|
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
|
|
https://docs.djangoproject.com/en/1.10/topics/http/urls/
|
|
|
|
"""
|
2017-02-16 01:01:36 +00:00
|
|
|
from django.conf.urls import url, include
|
2016-09-29 20:20:10 +00:00
|
|
|
from django.contrib import admin
|
2017-02-16 01:01:36 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.conf.urls.static import static
|
|
|
|
|
2017-03-06 15:50:55 +00:00
|
|
|
from rest_framework import routers
|
2016-09-29 20:20:10 +00:00
|
|
|
|
2017-03-06 15:50:55 +00:00
|
|
|
from storage import apiviews
|
|
|
|
|
2018-10-10 19:18:06 +00:00
|
|
|
from auth.views import auth_redirect
|
|
|
|
|
2017-03-06 15:50:55 +00:00
|
|
|
|
|
|
|
router = routers.DefaultRouter()
|
|
|
|
router.register(r'items', apiviews.ItemViewSet)
|
2017-04-28 12:14:27 +00:00
|
|
|
router.register(r'labels', apiviews.LabelViewSet)
|
2017-03-06 15:50:55 +00:00
|
|
|
|
|
|
|
# Wire up our API using automatic URL routing.
|
|
|
|
# Additionally, we include login URLs for the browsable API.
|
2016-09-29 20:20:10 +00:00
|
|
|
urlpatterns = [
|
2018-10-10 19:18:06 +00:00
|
|
|
url(r'^admin/login/.*', auth_redirect),
|
2016-09-29 20:20:10 +00:00
|
|
|
url(r'^admin/', admin.site.urls),
|
2017-02-16 15:14:37 +00:00
|
|
|
url(r'^select2/', include('django_select2.urls')),
|
2017-02-16 01:01:36 +00:00
|
|
|
|
|
|
|
url(r'^', include('storage.urls')),
|
2017-03-06 15:50:55 +00:00
|
|
|
url(r'^api/1/', include(router.urls)),
|
2017-02-28 23:16:10 +00:00
|
|
|
] \
|
|
|
|
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \
|
|
|
|
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|