Home > other >  Routing problem of Django
Routing problem of Django

Time:05-14

What do these two kinds of routing is not the same, I can just get in the way of DRF using a data, the way two routing errors, directly StoreIndexView class is inherited RetrieveAPIView, pk value directly in the routing can query target database

Way # a
Re_path (r '^ store/(? P \ d +)/index/$', Store the StoreIndexView. As_view ())
Way # 2
Re_path (r '^ store/(? P \ d +)/$', include ({
Re_path (r '^ index/$' Store. StoreIndexView. As_view ())
}), None)
  • Related