// archives

non-ascii

This tag is associated with 1 posts

Using non-ascii in Django templates

I hope some reader can help me uit here…
We were trying to use non Ascii characters (like ♥ for example) in the Django templates, but couldn’t get it to work.
We worked around this by using a template variable ( {{ nonAsciiHeart }} for example) and then put the following in the view:
nonAsciiHeart = ‘\xe2\x99\xa5′
return render(’example_template.html’, [...]

Categories

  • No categories

Django Hosting:

DjangoDays recommends the following Django hosting provider: