[Django]-Tastypie authentication / custom response

3👍

you can do that this way:

from tastypie.exceptions import ImmediateHttpResponse
from tastypie.http import HttpBadRequest

if test_fails:
    raise ImmediateHttpResponse(HttpBadRequest("User already exists"))
👤RickyA

Leave a comment