urls.py 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.conf import settings
  8. from django.contrib.auth.decorators import login_required
  9. router = routers.SimpleRouter()
  10. router.register(r'sharix-users', SharixUserMVS)
  11. router.register(r'group', GroupMVS)
  12. urlpatterns = [
  13. path('', login_required(IndexView.as_view()), name='home'),
  14. path('transactions/', login_required(TransactionsView.as_view()), name='transactions'),
  15. path('payment/', login_required(PaymentView.as_view()), name='payment'),
  16. # Страница "Сотрудничество" (запрос на подключение к сервису)
  17. path('cooperate/', login_required(CooperateView.as_view()), name='cooperate'),
  18. # Страница "О партнере"
  19. path('partner/', login_required(PartnerDetailView.as_view()), name='partner_detail'),
  20. path('partner/edit/', login_required(PartnerEditView.as_view()), name='partner_edit'),
  21. path('partner/doc/<str:doc_code>', login_required(PartnerDocEditView.as_view()), name='partner_doc_edit'),
  22. path('accounts/login/', LoginSharix.as_view(), name='authweb'),
  23. path('transactions/<int:trans_id>/', trans_id, name='transid'),
  24. path('logout/', logout_view, name='logoutweb'),
  25. path('balance/', balance, name='balance'),
  26. path('partners/', login_required(PartnersListView.as_view()), name='partners'),
  27. path('partners/change_status/', change_partners_status, name='partners/change_status'),
  28. path('resource/', login_required(ResourceListView.as_view()), name='resource'),
  29. path('resource/change_status/', change_resource_status, name='resource/change_status'),
  30. path('provider/', login_required(ProviderListView.as_view()), name='provider'),
  31. path('provider/change_status/', change_provider_status, name='provider/change_status'),
  32. path('service_tariff/', login_required(ServiceTariffListView.as_view()), name='service_tariff'),
  33. path('service_tariff/add/', login_required(ServiceTariffCreate.as_view()), name='service_tariff/add/'),
  34. path('service_tariff/edit/<int:pk>', login_required(ServiceTariffUpdateView.as_view()), name='service_tariff/edit/'),
  35. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  36. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  37. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  38. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  39. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='service_information-add'),
  40. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='service_information/edit/'),
  41. path('service/', ServiceListView.as_view(), name='service'),
  42. path('service/change_status/', change_service_status, name='service/change_status'),
  43. #path('partner_information/', login_required(PartnerInfoView.as_view()), name='partner_information/'),
  44. #path('partner_information/add/', login_required(PartnerInformationCreate.as_view()), name='partner_information/add/'),
  45. #path('partner_information/edit/<int:pk>', login_required(PartnerInformationUpdateView.as_view()), name='partner_information/edit/'),
  46. path('user_information', login_required(UserListView.as_view()), name='user_information'),
  47. path('api/v1/auth/', include('djoser.urls.authtoken'), name="api-auth"),
  48. path('api/v1/platform/', include(router.urls), name="api-platform"),
  49. path('senderphone/', PhoneSender.as_view()),
  50. #schemas
  51. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  52. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  53. path('schemav3/', schema_v3, name='schema'),
  54. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  55. ]