examerioLogin
← Fullstack with Vue.jsQuestion 41 of 62

In Django REST Framework ViewSets, which decorator is used to create a custom endpoint?

📘 Explanation

DRF's @action decorator is the standard way to add custom endpoints to a ViewSet, with detail=True targeting a single object and detail=False targeting the collection. The other options invent decorators like @route, @endpoint, or misuse @api_view and parameter names that don't exist in DRF.

Related questions

← PreviousNo login needed