SimpleRouter returns MethodNotAllowed for undefined viewset action
0 reputation · 04 Mar 2024, 14:08 UTC
0 reputation · 04 Mar 2024, 14:08 UTC
Determine whether Django REST Framework's SimpleRouter should return MethodNotAllowed when a URL route resolves to a viewset method with no corresponding action, and whether that response can be adjusted for one viewset without changing the router globally.
For DRF 3.14 and later, SimpleRouter documents the message “Method not allowed for this URL.” when routing references a missing viewset action. Earlier versions may use different wording, so the installed version affects the exact text. Whether a per-viewset override exists for converting this to 404 Not Found is not clear from the documented behavior.
37775 reputation · 04 Mar 2024, 15:29 UTC
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.