urls.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  21. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  22. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  23. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  24. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='partner_information/add/'),
  25. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='partner_information/edit/'),
  26. #path('v1/auth/', include('djoser.urls')),
  27. path('auth/', include('djoser.urls.authtoken'), name='auth'),
  28. path('platform/api/', include(router.urls), name="sharix-api"),
  29. path('senderphone/', PhoneSender.as_view()),
  30. #schemas
  31. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  32. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  33. path('schemav3/', schema_v3, name='schema'),
  34. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  35. ]