Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

40 rindas
1.6 KiB

  1. """workx URL Configuration
  2. The `urlpatterns` list routes URLs to views. For more information please see:
  3. https://docs.djangoproject.com/en/4.1/topics/http/urls/
  4. Examples:
  5. Function views
  6. 1. Add an import: from my_app import views
  7. 2. Add a URL to urlpatterns: path('', views.home, name='home')
  8. Class-based views
  9. 1. Add an import: from other_app.views import Home
  10. 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
  11. Including another URLconf
  12. 1. Import the include() function: from django.urls import include, path
  13. 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
  14. """
  15. from django.contrib import admin
  16. from django.urls import path,include
  17. from accounts.views import IncomeViewSet,ExpenseViewSet,ReimbursementViewSet
  18. from employee.views import EmployeeListCreateAPIView,EmployeeRetrieveUpdateAPIView,RoleListCreateAPIView
  19. from company.views import CompanyViewSet
  20. from rest_framework import routers
  21. from google_auth.views import login, callback
  22. router = routers.DefaultRouter()
  23. router.register(r'company', CompanyViewSet)
  24. router.register(r'accounts/income', IncomeViewSet)
  25. router.register(r'accounts/reimbursement', ReimbursementViewSet)
  26. router.register(r'accounts/expense', ExpenseViewSet)
  27. urlpatterns = [
  28. path('admin/', admin.site.urls),
  29. path('', include(router.urls)),
  30. path('employees/', EmployeeListCreateAPIView.as_view(), name='employee-list-create'),
  31. path('employees/<int:pk>/', EmployeeRetrieveUpdateAPIView.as_view(), name='employee-retrieve-update'),
  32. path('roles/', RoleListCreateAPIView.as_view(), name='role-list-create'),
  33. path('google-auth/', include('google_auth.urls')),
  34. ]