from django import template
register=template.Library()
@register.filter
@stringfilter
def typographus(string):
"""Russian typorgify"""
if type(string) is not unicode:
string = unicode(string)
return Typographus().process(string)
{% extends "base.html" %}
{% load typographus %}
...
{% block content %}
{% autoescape off %}
<h1>{{ portfolio.title|typographus }}</h1>
{{ portfolio.text|linebreaks|typographus }}
{% endautoescape %}
{% endblock %}
Source: https://habr.com/ru/post/42860/