Jquery Post Error Handling In Python