The Startup
Published in

The Startup

Using Nested Routers DRF-Nested Routers in Django Rest framework

Introduction

The article introduces how to use DRF-Nested-Routers framework https://github.com/alanjds/drf-nested-routers to create URLs for nested resources. In this tutorial, our target is to create APIs for getting libraries and books.

/api/libraries/ -> Get list of libraries
/api/libraries/{library_id}/books/ -> Get

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store