Reputation: 159
I need cyrillic symbols in my website and it's work fine if it in template like: Привет, мир!
or {{ some_text }}
if i take it from MySQL database. But it doesnt work if i do something like this in views.py:
text = "Привет, мир!"
return render(request, 'index.html', {'text':text})
template:
{{ text }}
In windows it works OK, but in my production linux server it just outputs nothing. What is wrong? Thanks.
Upvotes: 1
Views: 442
Reputation: 159
Ok, i use unicode("Привет, мир!", cp1251)
instead of "Привет, мир!"
or u"Привет, мир!"
and now it works.
Upvotes: 1