urls.py 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. from django.contrib.auth.views import LogoutView
  2. from django.contrib.auth.decorators import login_required
  3. from django.urls import path, include, re_path
  4. from django_spaghetti.views import Plate
  5. from schema_graph.views import Schema
  6. from rest_framework import routers
  7. from sharix_admin.views import *
  8. from sharix_admin.apiviews import *
  9. router = routers.SimpleRouter()
  10. router.register(r'sharix-users', SharixUserMVS)
  11. router.register(r'group', GroupMVS)
  12. app_name = "sharix_admin"
  13. urlpatterns = [
  14. # Регистрация / Вход / Выход
  15. path('auth/signup/', ShariXSignUpView.as_view(), name="auth_signup"),
  16. path('auth/login/', ShariXLoginView.as_view(), name='auth_login'),
  17. path('auth/logout/', login_required(LogoutView.as_view()), name="auth_logout"),
  18. path('auth/reset-password/', ShariXResetPasswordView.as_view(), name='auth_reset_password'),
  19. # Главная
  20. path('', login_required(MainView.as_view()), name='main'),
  21. # --- Ниже страницы, требующие ревью ---
  22. path('transactions/', login_required(TransactionsView.as_view()), name='transactions'),
  23. path('payment/', login_required(PaymentView.as_view()), name='payment'),
  24. # Страница "Сотрудничество" (запрос на подключение к сервису)
  25. path('cooperate/', login_required(CooperateView.as_view()), name='cooperate'),
  26. # Страница "О партнере"
  27. path('partner/', login_required(PartnerDetailView.as_view()), name='partner_detail'),
  28. path('partner/edit/', login_required(PartnerEditView.as_view()), name='partner_edit'),
  29. path('partner/doc/<str:doc_code>/upload', login_required(PartnerDocUploadView.as_view()), name='partner_doc_upload'),
  30. path('partner/doc/<str:doc_code>', login_required(PartnerDocView.as_view()), name='partner_doc'),
  31. path('transactions/<int:trans_id>/', trans_id, name='transid'),
  32. path('balance/', balance, name='balance'),
  33. path('partners/', login_required(PartnersListView.as_view()), name='partners'),
  34. path('partners/change_status/', change_partners_status, name='partners/change_status'),
  35. path('resource/', login_required(ResourceListView.as_view()), name='resource'),
  36. path('resource/change_status/', change_resource_status, name='resource/change_status'),
  37. path('provider/', login_required(ProviderListView.as_view()), name='provider'),
  38. path('provider/change_status/', change_provider_status, name='provider/change_status'),
  39. path('service_tariff/', login_required(ServiceTariffListView.as_view()), name='service_tariff'),
  40. path('service_tariff/add/', login_required(ServiceTariffCreate.as_view()), name='service_tariff/add/'),
  41. path('service_tariff/edit/<int:pk>', login_required(ServiceTariffUpdateView.as_view()), name='service_tariff/edit/'),
  42. path('service_type/', login_required(ServiceTypeListView.as_view()), name='service_type'),
  43. path('service_type/edit/<int:pk>', login_required(ServiceTypeUpdateView.as_view()), name='service_type/edit/'),
  44. path('service_type/add/', login_required(ServiceTypeCreate.as_view()), name='service_type/add/'),
  45. path('service_type/delete/<int:pk>', login_required(ServiceTypeDelete.as_view()), name='service_type/delete/'),
  46. path('service_information/add/', login_required(ServiceInformationCreate.as_view()), name='service_information-add'),
  47. path('service_information/edit/<int:pk>', login_required(ServiceInformationUpdateView.as_view()), name='service_information/edit/'),
  48. path('service/', ServiceListView.as_view(), name='service'),
  49. path('service/change_status/', change_service_status, name='service/change_status'),
  50. #path('partner_information/', login_required(PartnerInfoView.as_view()), name='partner_information/'),
  51. #path('partner_information/add/', login_required(PartnerInformationCreate.as_view()), name='partner_information/add/'),
  52. #path('partner_information/edit/<int:pk>', login_required(PartnerInformationUpdateView.as_view()), name='partner_information/edit/'),
  53. path('user_information', login_required(UserListView.as_view()), name='user_information'),
  54. path('api/v1/auth/', include('djoser.urls.authtoken'), name="api-auth"),
  55. path('api/v1/platform/', include(router.urls), name="api-platform"),
  56. path('senderphone/', PhoneSender.as_view()),
  57. #schemas
  58. path('schemav1/', login_required(Schema.as_view()), name='schemav1'),
  59. path('schemav2/', login_required(Plate.as_view()), name='schemav2'),
  60. path('schemav3/', schema_v3, name='schema'),
  61. re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
  62. ]