1
0

urls.py 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. from django.conf.urls.static import static
  10. router = routers.SimpleRouter()
  11. router.register(r'sharix-users', SharixUserMVS)
  12. router.register(r'group', GroupMVS)
  13. urlpatterns = [
  14. path('', login_required(IndexView.as_view()), name='home'),
  15. path('transactions/', login_required(TransactionsView.as_view()), name='transactions'),
  16. path('payment/', login_required(PaymentView.as_view()), name='payment'),
  17. # Страница "Сотрудничество" (запрос на подключение к сервису)
  18. path('cooperate/', login_required(CooperateView.as_view()), name='cooperate'),
  19. # Страница "О партнере"
  20. path('partner/', login_required(PartnerDetailView.as_view()), name='partner_detail'),
  21. path('partner/edit/', login_required(PartnerEditView.as_view()), name='partner_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('payment/', login_required(PaymentView.as_view()), name='payment'),
  27. path('payment_way/', login_required(paymentWayView), name='payment_way'),
  28. path('account/', login_required(AccountView), name='account'),
  29. path('account/delete/<int:pk>/', login_required(AccountDelete.as_view()), name='account/delete/'),
  30. path('account/edit/<int:pk>/', login_required(AccountUpdateView.as_view()), name='account/edit/'),
  31. path('task_management/', login_required(TaskListView.as_view()), name='task_management'),
  32. path('comments/', login_required(CommentsListView.as_view()), name='comments'),
  33. path('comments/change_status/', change_comments_status, name='comments/change_status'),
  34. path('comments/delete/<int:pk>', login_required(CommentsDelete.as_view()), name='comments/delete/'),
  35. path('tech_support/', login_required(TechListView.as_view()), name='tech_support'),
  36. path('tech_support/edit/<int:pk>', login_required(CommentsUpdateView.as_view()), name='tech_support/edit/'),
  37. path('tech_support/add/', login_required(CommentsCreate.as_view()), name='tech_support/add/'),
  38. path('tech_support/delete/<int:pk>', login_required(TechSupDelete.as_view()), name='tech_support/delete/'),
  39. path('partners/', login_required(PartnersListView.as_view()), name='partners'),
  40. path('partners/change_status/', change_partners_status, name='partners/change_status'),
  41. path('resource/', login_required(ResourceListView.as_view()), name='resource'),
  42. path('resource/change_status/', change_resource_status, name='resource/change_status'),
  43. path('provider/', login_required(ProviderListView.as_view()), name='provider'),
  44. path('provider/change_status/', change_provider_status, name='provider/change_status'),
  45. path('service_tariff/', login_required(ServiceTariffListView.as_view()), name='service_tariff'),
  46. path('service_tariff/add/', login_required(ServiceTariffCreate.as_view()), name='service_tariff/add/'),
  47. path('service_tariff/edit/<int:pk>', login_required(ServiceTariffUpdateView.as_view()), name='service_tariff/edit/'),
  48. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  49. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  50. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  51. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  52. #
  53. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='service_information-add'),
  54. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='service_information/edit/'),
  55. path('service/', ServiceListView.as_view(), name='service'),
  56. path('service/change_status/', change_service_status, name='service/change_status'),
  57. #path('partner_information/', login_required(PartnerInfoView.as_view()), name='partner_information/'),
  58. #path('partner_information/add/', login_required(PartnerInformationCreate.as_view()), name='partner_information/add/'),
  59. #path('partner_information/edit/<int:pk>', login_required(PartnerInformationUpdateView.as_view()), name='partner_information/edit/'),
  60. path('user_information', login_required(UserListView.as_view()), name='user_information'),
  61. path('user_information/delete/<int:pk>', login_required(UserDelete.as_view()), name='user_information/delete/'),
  62. path('api/v1/auth/', include('djoser.urls.authtoken'), name="api-auth"),
  63. path('api/v1/platform/', include(router.urls), name="api-platform"),
  64. path('senderphone/', PhoneSender.as_view()),
  65. #schemas
  66. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  67. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  68. path('schemav3/', schema_v3, name='schema'),
  69. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  70. ]
  71. if settings.DEBUG:
  72. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)