1👍
✅
Have you tried localizing the message right before you display it?
In your view:
user.message_set.create(message="Message")
In your template
{% if messages %}
<ul>
{% for message in messages %}
<li>{% trans message %}</li>
{% endfor %}
</ul>
{% endif %}
This way, you don’t have to store any odd characters in your database.
1👍
user.message_set.create(message=_("Message"))
… should work. Are you using the latest version of SQLite, does UTF-8 support have to be enabled somehow? Are you storing non-ascii characters in SQLite elsewhere?
- [Answered ]-Having trouble installing Django from Windows cmd. "pip install django" showing error although PATH should be set
- [Answered ]-PostgreSQL pg_database_size different from sum of pg_total_relation_size
- [Answered ]-Django efficient way to operate on cache values using redist
Source:stackexchange.com