I would like to replace default django 404 (and other in the future) with the DRF response, as easy as it is possible, just to return (standard DRF response):
{
"detail": "Not found."
}
So I put this code in my url.py file.
from rest_framework.exceptions import NotFound
from django.conf.urls import handler404
handler404 = NotFound
When I set Debug flag (in the set Ture I'm geting 500, when set it to False 404 but in the html form.
I've read doc here: http://www.django-rest-framework.org/api-guide/exceptions/ but to be honest I don't know how to put this into reality.
it seems to be easy, but somehow I failed to implement this (above code comes form the other SO threads).
Thank you in advance