我正在使用JSONField here,例如:
sets = JSONField(null=True, blank=True)
然而,当我的应用程序(Native not Python)写入具有额外字符的API Django商店时,"
变为u'
,为什么会这样,我该如何阻止它?
示例返回数据......
"设置":" {u' position':{u' y':u' -121-07'等..
答案 0 :(得分:1)
{2.}}由Python 2.x添加,因为JSONField正在使用u
个字符串。
他们没有伤害。但是,如果您不想看到这一点,您可以尝试使用Python 3.x,因为默认情况下字符串为unicode
。
另见Suppress the u'prefix indicating unicode' in python strings。