I want to return the format:
res['result'] == False and res['error_message'] == 'Unknown User'
How to do it in views.py?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you trying to return a JSON response? In that case set your renderer as
jsonand return a dict containing the values you want.Obviously you’ll need to add other stuff for your specific view/route combination, but this is all covered in the Pyramid documentation