urls.py 504 B

123456789101112131415161718
  1. # 添加路由
  2. from django.conf.urls import url
  3. from rest_framework_bulk.routes import BulkRouter
  4. from workreport.views import ReportView, DailyReportView, LoginView, LogoutView
  5. router = BulkRouter()
  6. router.register(r'dailyreport', DailyReportView)
  7. router.register(r'dailyreport1', DailyReportView)
  8. urlpatterns = router.urls
  9. urlpatterns += [
  10. url(r'report/<int:name>/', ReportView.as_view()),
  11. url(r'login/', LoginView.as_view()),
  12. url(r'logout/', LogoutView.as_view())
  13. ]