import json
I'm trying to create a simple json error message to return if I receive a 404 error during the course of my program, but it isn't working as I anticipated.
error_data = '{"can_post": "error", "website": "error"}'
print json.dumps(error_data)
gives me:
"{\"can_post\": \"error\", \"website\": \"error\"}"
what am I doing wrong? I expected:
{"can_post": "error", "website": "error"}
I realize I could do this:
error_data = '{"can_post": "error", "website": "error"}'
print json.dumps(error_data)
Which works.