我试图在python中使用双引号保存变量,因为我需要将双引号JSON传递给模板,单引号不能用于我正在做的事情.所以我将python中的变量设置为:
json = {
"auth": {
"key": "auth-code-here"
},
"template_id": "id-here",
"redirect_url": "url-here",
}
Run Code Online (Sandbox Code Playgroud)
但是直接在python中,它被保存为
{'redirect_url': 'url-here', 'template_id': 'id-here', 'auth': {'key': 'auth-code-here'}}
Run Code Online (Sandbox Code Playgroud)
有没有办法可以将它保存为双引号?或者我是否需要在django模板中处理这个以替换双引号的单引号?
谢谢!
| 归档时间: |
|
| 查看次数: |
3815 次 |
| 最近记录: |