urls.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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('partners/', login_required(PartnersListView.as_view()), name='partners'),
  21. path('partners/change_status/', change_partners_status, name='partners/change_status'),
  22. path('resource/', login_required(ResourceListView.as_view()), name='resource'),
  23. path('resource/change_status/', change_resource_status, name='resource/change_status'),
  24. #path('v1/auth/', include('djoser.urls')),
  25. path('auth/', include('djoser.urls.authtoken'), name='auth'),
  26. path('platform/api/', include(router.urls), name="sharix-api"),
  27. path('senderphone/', PhoneSender.as_view()),
  28. #schemas
  29. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  30. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  31. path('schemav3/', schema_v3, name='schema'),
  32. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  33. ]