python 2.7 - How to return HTTP 400 response in Django? -


If I receive the request received data is invalid and can not be parsed then I will return an HTTP 400 response from my DjangoView function Want to do

How can I do this? It does not seem that the corresponding exception class is for 404:

  raise http404  

< Div class = "post-text" itemprop = "text">

From my previous comment:

You can also return

, you have an exception sub-class Http404 can make your own HTML 400 exception.

Regards,


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -