我從django教程中添加了standart評論模型('django.contrib.comments'和'django.contrib.sites'),它工作正常。但是,當我嘗試顯示評論管理評論列表,它會導致錯誤:django內置評論模型管理導致UTF-8錯誤
UnicodeDecodeError at /admin/comments/comment/
'utf8' codec can't decode byte 0xc2 in position 80: invalid continuation byte
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/comments/comment/
Django Version: 1.6.4
Exception Type: UnicodeDecodeError
Exception Value:
'utf8' codec can't decode byte 0xc2 in position 80: invalid continuation byte
Exception Location: C:\Python27\lib\encodings\utf_8.py in decode, line 16
Python Executable: C:\Python27\python.exe
Python Version: 2.7.6
Unicode error hint
The string that could not be encoded/decoded was: ONE '������
Error during template rendering
In template C:\Users\Harkonnen\PycharmProjects\alpha\grappelli\templates\admin\change_list.html, error at line 207
utf8
205 <!-- DATE HIERARCHY -->
206 {% block date_hierarchy %}
207 {% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}
208 {% endblock %}
是否有可能解決,而不編輯非標準的Django或grappeli模型這個錯誤?
UPD:withut格拉佩利同樣的錯誤=(
In template C:\Python27\lib\site-packages\django\contrib\admin\templates\admin\change_list.html, error at line 73
73 {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
我的config中沒有DEFAULT_CHARSET,所以它默認是'utf-8'。試圖定義它,仍然是相同的錯誤。 – Harkonnen