在我的django应用程序中,我有一些对象导致django管理员中的相应URL为非ascii.(例如:http://mysite/admin/myapp/myclass/Présentation/)
我可以编辑对象没有任何问题,但当我保存它时,我有以下错误:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 24: ordinal not in range(128), HTTP response headers must be in US-ASCII format
奇怪的是,对象被正确保存到数据库中.
有谁知道Django管理员如何管理unicode?任何有助于解决此问题的信息,指针或想法将不胜感激.
提前致谢
更新:这是模型的代码
class Plugin(models.Model):
"""Some subcontent that can be added to a given page"""
class Meta:
ordering = ['ordering']
name = models.CharField(max_length=32, primary_key=True)
div_id = models.CharField(default='rightcol', max_length=32)
published = models.BooleanField(default=True,
help_text=_("If this is not checked, it is not displayed on the page."))
ordering = models.IntegerField(default=1,
help_text=_("plugins are sorted with this number in …Run Code Online (Sandbox Code Playgroud)