how can I return JSON response for queries to non-existent endpoints?
For example: query to /api/rock?q=123, but the api have /api/paper only, and then the server return {'error': 'endpoint not found'} or something.
I'm using Django Rest Framework 3.14.0, Django 4.1.7, help please.
I checked exception_handler in views.py, but how can I return a custom response for non-existent endpoints?
I've read the documentation, but I can't get this done. Returns the default response for Django resources not found.