【问题标题】:How to use special chars in admindocs?如何在 admindocs 中使用特殊字符?
【发布时间】:2013-08-09 09:49:28
【问题描述】:

我有一些特殊字符的模型的 cmets,例如:

[...] informacją [...]

但是当我运行 admin 我得到:

'ascii' codec can't decode byte 0xc4 in position 23: ordinal not in range(128). You passed in <django.utils.functional.__proxy__ object at 0x7f0e3b35aa50> (<class 'django.utils.functional.__proxy__'>)

我有:

# -*- coding: utf-8 -*-

在文件的开头。这是在我安装 django-admin-tools 时发生的

【问题讨论】:

  • 请粘贴完整的回溯

标签: django django-admin-tools


【解决方案1】:

尝试使用unicode函数:

output = unicode(stringWithSpecialChars)

【讨论】:

    猜你喜欢
    • 2015-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多