Lynxbee topic

Django REST Framework

Articles about Django REST Framework.

Fix MultipleObjectsReturned in Django and DRF

Django raises MultipleObjectsReturned when get() matches more than one row. The real fix depends on the domain: return a collection when duplicates are valid, or repair data and enforce uniqueness when exactly one row should exist.

Django REST Framework Routers, Without the Magic

A Django REST Framework router is a URL-pattern generator for ViewSets—not the browsable API itself. Build a small API, inspect every generated route, understand basename and action naming, and know when explicit paths are the clearer choice.

Protect the DRF API Root with Login and Permissions

Adding a Login link to Django REST Framework’s browsable API does not protect an endpoint. This walkthrough combines session authentication with an explicit permission policy, verifies anonymous and logged-in behavior, and closes the production security gaps beginners often miss.

Engineering weekly

Useful technical knowledge, not inbox noise.

Receive verified fixes, references, labs, and tools. Confirm by email; unsubscribe any time.