urls.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from django.urls import path, include, re_path
  2. from .views import *
  3. from .apiviews import *
  4. from rest_framework import routers
  5. from django_spaghetti.views import Plate
  6. from schema_graph.views import Schema
  7. from django.contrib.auth.decorators import login_required
  8. router = routers.SimpleRouter()
  9. router.register(r'sharix-users', SharixUserMVS)
  10. router.register(r'group', GroupMVS)
  11. urlpatterns = [
  12. #path('auth/', LoginSharix.as_view(), name='auth'),
  13. path('accounts/login/', LoginSharix.as_view(), name='authweb'),
  14. path('', index, name='home'),
  15. path('transactions/', transactions, name='trans'),
  16. path('transactions/<int:trans_id>/', trans_id, name='transid'),
  17. path('logout/', logout_view, name='logoutweb'),
  18. path('balance/', balance, name='balance'),
  19. path('test/', testPage, name='test-page'),
  20. path('servicetype/', servicetype, name='servicetype'),
  21. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  22. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  23. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  24. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  25. #path('v1/auth/', include('djoser.urls')),
  26. path('auth/', include('djoser.urls.authtoken'), name='auth'),
  27. path('platform/api/', include(router.urls), name="sharix-api"),
  28. path('senderphone/', PhoneSender.as_view()),
  29. #schemas
  30. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  31. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  32. path('schemav3/', schema_v3, name='schema'),
  33. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  34. ]