1👍
✅
You should avoid problems if you use unicode strings in your models, e.g. verbose_name=u"Wydział"
.
You might prefer to import unicode_literals from the future library, as recommended by the Django docs. Be careful if adding this to an existing module though!
from __future__ import unicode_literals
0👍
Unicode vs python string problem. The Django docs have moved further down the path toward python 3, so they aren’t in the habit of warning you anymore. In python2, put a u in front of the string, e.g., u"Wydział"
. Since you’re running 2.7, you can try from __future__ import unicode_literals
. Note that this second solution could break some other things in your project.
- Why can I not get a field's datetime value from queryset?
- Django 1.95 template i18n not working
- [android][python] open image from absolute path in localhost
- Django: import Topic Issue, word Topic shows instead of title?
Source:stackexchange.com