"""ERP_5 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, re_path from rest_framework.routers import DefaultRouter from .views import supplier_views, customer_views, area_viewsets, settlement_account_views, warehouse_views from rest_framework_jwt.views import obtain_jwt_token urlpatterns = [ # path('admin/', admin.site.urls), # path('users/login/', obtain_jwt_token), # 登录并且由JWT签发token # re_path(r'^users/reset/(?P\d+)/$', user_views.ResetPasswordView.as_view()), ] router = DefaultRouter() router.register('suppliers', supplier_views.SupplierViewSet) router.register('customers', customer_views.CustomerViewSet) router.register(r'nation', area_viewsets.NationView) # 国家的视图接口 router.register(r'province', area_viewsets.ProvinceView) # 省份的视图接口 router.register(r'city', area_viewsets.CityView) # 城市的视图接口 router.register(r'warehouses', warehouse_views.WarehouseView) # router.register(r'accounts', settlement_account_views.AccountView) # urlpatterns += router.urls