Single vs double quotes in JSON

JSON syntax is not Python syntax. JSON requires double quotes for its strings.


you can use ast.literal_eval()

>>> import ast
>>> s = "{'username':'dfdsfdsf'}"
>>> ast.literal_eval(s)
{'username': 'dfdsfdsf'}