0

I have ajax call:

$.ajax({
        type: "POST",
        url: "../getFormMetaData/",
        cache:false,
        data: $data,
        success: createZoomDialog,
        error:function(response){

        }
    });

how can I send data to ajax error handler from python django?

1
  • Just send 4xx or 5xx status code on response, js will route it into error callback. Commented Jan 24, 2014 at 13:04

1 Answer 1

1

You can return HttpResponse with a 4xx error code in your view:

def view(request):
    return HttpResponse("error", status=404)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.