小编Jam*_*shy的帖子

从 Django Rest Framework 中的 Json 字符串中删除反斜杠

dct_data = json_tour_data.__dict__
tour_data = json.dumps(dct_data)
Run Code Online (Sandbox Code Playgroud)

如何从json中删除这些反斜杠?这是我的输出:

"{\"strFileOpenDateAjxKey\": \"2018-01-16 12:40:22.526417\", 
\"strFilePassengerAjxKey\": \"Zahra Walji\", \"strFileOpenMobileAjxKey\": 
\"46464664\", \"strFileOpenDepartmentAjxKey\": \"Finance department\", 
\"strFileOpenAccountCodeAjxKey\": \"CARTZS\", 
\"strFileOpenProfileCodeAjxKey\": \"CARTZS\", 
\"strFileopenOriginalCountryIdAjxKey\": 61, \"blnBoundAjxKey\": 1, 
\"strTransactionCurrencyJsKey\": \"Shillings\", 
\"intCurrencyPrecisionJsKey\": 3, \"strPackageTypeJsKey\": \"PKG\", 
\"strUserNameAjxKey\": \"admin\", \"strPasswordAjxKey\": \"1234\"}"
Run Code Online (Sandbox Code Playgroud)

python json django-rest-framework

3
推荐指数
1
解决办法
8213
查看次数

标签 统计

django-rest-framework ×1

json ×1

python ×1