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

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

php - proc_open Too many open files in long running Symfony Console app -

c# - Show a huge number of data in DevExpress GridView -