urls.py 839 B

1234567891011121314151617
  1. from django.conf.urls import url, include
  2. from rest_framework import routers
  3. from .views import KeywordMissionViewSet, DateMissionViewSet, TimeMissionViewSet, PageMissionViewSet, UserViewSet
  4. router = routers.DefaultRouter()
  5. router.register(r'keyword_mission', KeywordMissionViewSet, basename="keywordmission")
  6. router.register(r'user', UserViewSet, basename="user")
  7. router.register(r'date_mission', DateMissionViewSet, basename="datemission")
  8. router.register(r'time_mission', TimeMissionViewSet, basename="timemission")
  9. router.register(r'page_mission', PageMissionViewSet, basename="pagemission")
  10. # 使用自动URL路由连接API。
  11. # 另外,我们还包括支持浏览器浏览API的登录URL。
  12. urlpatterns = [
  13. url(r'^', include(router.urls)),
  14. url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
  15. ]