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

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -

c# - Roxy file manager in MVC doesn't accept session path -