urls.py 5.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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('tasks/change_status/', change_tasks_status, name='tasks/change_status'),
  32. path('task_management/', login_required(TaskListView.as_view()), name='task_management'),
  33. path('task_management/add/', login_required(TaskCreate.as_view()), name='task_management/add/'),
  34. path('task_management/edit/<int:pk>', login_required(TasksUpdateView.as_view()), name='task_management/edit/'),
  35. path('comments/', login_required(CommentsListView.as_view()), name='comments'),
  36. path('comments/change_status/', change_comments_status, name='comments/change_status'),
  37. path('comments/delete/<int:pk>', login_required(CommentsDelete.as_view()), name='comments/delete/'),
  38. path('tech_support/', login_required(TechListView.as_view()), name='tech_support'),
  39. path('tech_support/edit/<int:pk>', login_required(CommentsUpdateView.as_view()), name='tech_support/edit/'),
  40. path('tech_support/add/', login_required(CommentsCreate.as_view()), name='tech_support/add/'),
  41. path('tech_support/delete/<int:pk>', login_required(TechSupDelete.as_view()), name='tech_support/delete/'),
  42. path('partners/', login_required(PartnersListView.as_view()), name='partners'),
  43. path('partners/change_status/', change_partners_status, name='partners/change_status'),
  44. path('resource/', login_required(ResourceListView.as_view()), name='resource'),
  45. path('resource/change_status/', change_resource_status, name='resource/change_status'),
  46. path('provider/', login_required(ProviderListView.as_view()), name='provider'),
  47. path('provider/change_status/', change_provider_status, name='provider/change_status'),
  48. path('service_tariff/', login_required(ServiceTariffListView.as_view()), name='service_tariff'),
  49. path('service_tariff/add/', login_required(ServiceTariffCreate.as_view()), name='service_tariff/add/'),
  50. path('service_tariff/edit/<int:pk>', login_required(ServiceTariffUpdateView.as_view()), name='service_tariff/edit/'),
  51. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  52. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  53. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  54. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  55. #
  56. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='service_information-add'),
  57. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='service_information/edit/'),
  58. path('service/', ServiceListView.as_view(), name='service'),
  59. path('service/change_status/', change_service_status, name='service/change_status'),
  60. #path('partner_information/', login_required(PartnerInfoView.as_view()), name='partner_information/'),
  61. #path('partner_information/add/', login_required(PartnerInformationCreate.as_view()), name='partner_information/add/'),
  62. #path('partner_information/edit/<int:pk>', login_required(PartnerInformationUpdateView.as_view()), name='partner_information/edit/'),
  63. path('user_information', login_required(UserListView.as_view()), name='user_information'),
  64. path('user_information/delete/<int:pk>', login_required(UserDelete.as_view()), name='user_information/delete/'),
  65. path('api/v1/auth/', include('djoser.urls.authtoken'), name="api-auth"),
  66. path('api/v1/platform/', include(router.urls), name="api-platform"),
  67. path('senderphone/', PhoneSender.as_view()),
  68. #schemas
  69. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  70. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  71. path('schemav3/', schema_v3, name='schema'),
  72. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  73. ]
  74. if settings.DEBUG:
  75. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)