urls.py 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. from django.urls import path, include, re_path
  2. from SharixAdmin.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('provider/', login_required(ProviderListView.as_view()), name='provider'),
  25. path('provider/change_status/', change_provider_status, name='provider/change_status'),
  26. path('service_tariff/', login_required(ServiceTariffListView.as_view()), name='service_tariff'),
  27. path('service_tariff/add/', login_required(ServiceTariffCreate.as_view()), name='service_tariff/add/'),
  28. path('service_tariff/edit/<int:pk>', login_required(ServiceTariffUpdateView.as_view()), name='service_tariff/edit/'),
  29. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  30. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  31. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  32. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  33. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='service_information/add/'),
  34. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='service_information/edit/'),
  35. path('service/', ServiceListView.as_view(), name='service'),
  36. path('service/change_status/', change_service_status, name='service/change_status'),
  37. path('partner_information/add/', login_required(PartnerInformationCreate.as_view()), name='partner_information/add/'),
  38. path('partner_information/edit/<int:pk>', login_required(PartnerInformationUpdateView.as_view()), name='partner_information/edit/'),
  39. #path('v1/auth/', include('djoser.urls')),
  40. path('auth/', include('djoser.urls.authtoken'), name='auth'),
  41. path('platform/api/', include(router.urls), name="sharix-api"),
  42. path('senderphone/', PhoneSender.as_view()),
  43. #schemas
  44. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  45. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  46. path('schemav3/', schema_v3, name='schema'),
  47. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  48. ]