示例#1
0
from django.conf.urls import url, include
from rest_framework import routers
from api.viewsets.user import UserViewSet
from api.viewsets.spark_job import SparkJobViewSet
from api.views import FileUploadView
from django.views.decorators.csrf import csrf_exempt

router = routers.DefaultRouter()
router.register(r'users', UserViewSet)
router.register(r'spark-jobs', SparkJobViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^upload_data/$', csrf_exempt(FileUploadView.as_view())),
]
示例#2
0
    url(r'^dbs/(?P<db_name>\w+)$',
        TablesListAPIView.as_view(),
        name='tbs-list'),

    # masters list and details
    # /dbs/[db_name]/tbs/[master_name]/records
    url(r'^dbs/(?P<db_name>\w+)/(?P<master_name>\w+)$',
        MastersListCreateAPIView.as_view(),
        name='master_create_list'),
    # /dbs/[db_name]/tbs/[master_name]/[record_id]
    url(r'^dbs/(?P<db_name>\w+)/(?P<master_name>\w+)/(?P<master_id>\d+)$',
        MasterAPIView.as_view(),
        name='master_crud'),

    # details list and details
    # /dbs/[db_name]/[master_name]/[record_id]/[detail_name]
    url(r'^dbs/(?P<db_name>\w+)/(?P<master_name>\w+)/(?P<master_id>\d+)/(?P<detail_name>\w+)$',
        DetailsListCreateAPIView.as_view(),
        name='detail_create_list'),
    # /dbs/[db_name]/[master_name]/[record_id]/[detail_name]/[detail_id]
    url(r'^dbs/(?P<db_name>\w+)/(?P<master_name>\w+)/(?P<master_id>\d+)/(?P<detail_name>\w+)/(?P<detail_id>\d+)$',
        DetailsAPIView.as_view(),
        name='detail_crud'),

    # /dbs/[db_name]/[master_name]/[master_id]/upload_files/[file_name]
    url(r'^docs$', FileUploadView.as_view(), name='file_upload'),

    # /login
    url(r'^login$', LoginView.as_view(), name='login'),
]
示例#3
0
"""industrie URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include, re_path
from api.resources import IndustrieResource, UserResource
from api.views import FileUploadView

industrie_resource = IndustrieResource()
apps_register = UserResource()

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^apps/', include(apps_register.urls)),
    re_path(r'^api/', include(industrie_resource.urls)),
    re_path(r'^upload/(?P<filename>[^/]+)$', FileUploadView.as_view())
]
示例#4
0
from django.conf.urls import url, include
from rest_framework import routers
from api.views import GroupViewSet, GradeViewSet, FileUploadView, GroupMembersViewSet, AttendanceViewSet, AttendancePostView, PersonViewSet, SubjectViewSet

router = routers.DefaultRouter()
router.register(r'groups', GroupViewSet)
router.register(r'attendances', AttendanceViewSet)
router.register(r'groups/members/(?P<group_id>[0-9]+)', GroupMembersViewSet,
                "people")
router.register(r'people', PersonViewSet)
router.register(r'subjects', SubjectViewSet)
router.register(r'grades', GradeViewSet)

urlpatterns = [
    url(r'^attendances/addmember/$', AttendancePostView.as_view()),
    url(r'^upload/$', FileUploadView.as_view()),
    url(r'^', include(router.urls)),
]
示例#5
0
# Admin
router.register(r'tags', TagView, basename='tags')
router.register(r'countries', CountryView, basename='countries')
router.register(r'varietals', VarietalView, basename='varietals')
router.register(r'languages', LanguageView, basename='languages')
router.register(r'genders', GenderView, basename='genders')
router.register(r'event-categories',
                EventCategoryView,
                basename='event-categories')
router.register(r'approve-wineries',
                WineryApprovalView,
                basename='approve-wineries')

# Patterns
urlpatterns = [
    path('', include(router.urls)),
    path('', include(wine_lines_router.urls)),
    path('', include(wines_router.urls)),
    path('', include(ratings_router.urls)),
    path('', include(event_occurrences_router.urls)),
    path('', include(restaurant_occurrences_router.urls)),
    path('', include(event_reservations_router.urls)),
    path('', include(restaurant_reservations_router.urls)),
    path('', include(restaurant_ratings_router.urls)),
    path('maps/', MapsView.as_view()),
    path('reports/reservations/',
         ReportsView.as_view(),
         name='reservation-count-reports'),
    path('upload/', FileUploadView.as_view()),
]