// the find
alanjds/drf-nested-routers
Nested Routers for Django Rest Framework
drf-nested-routers adds nested URL routing to Django REST Framework, so you can express parent-child resource relationships like /domains/{domain_pk}/nameservers/ without wiring it by hand. It's a thin layer over DRF's existing router machinery that also ships nested serializer helpers and hyperlink fields. If you're building a REST API with DRF and need proper hierarchical URLs, this is the de facto solution.
The routing composition model is clean — you chain NestedSimpleRouter onto any existing router and it just works for N levels deep. It tracks DRF releases well; the CI matrix currently covers Django 4.2–5.2 and DRF 3.14–3.16 with Python 3.9–3.13. The NestedHyperlinkedModelSerializer with parent_lookup_kwargs is a genuinely useful addition that handles the ugly part of generating correct URLs for nested resources. The codebase is small enough that you can read the whole router.py in an afternoon if something breaks.
The README still opens with 'this is a work in progress / works for me' — that disclaimer has been there for years and is now misleading noise, but it sets an accurate tone for the maintenance pace. There's no built-in enforcement that the nested child actually belongs to the parent; every viewset has to filter get_queryset() manually, and if you forget, you have an authorization hole. Deep nesting (3+ levels) requires a lot of boilerplate that the library doesn't help reduce — you're on your own wiring up each layer. Documentation lives in a barely populated docs/ folder backed by mkdocs that appears to be mostly a copy of the README.