Как распечатать разрывы строк в шаблоне Django Python

{'quotes': u'Live before you die.\n\n"Dream as if you\'ll live forever, live as if you\'ll die today"\n\n"Love one person, take care of them until you die. You know, raise kids. Have a good life. Be a good friend. Try to be completely who you are, figure out what you personally love and go after it with everything you\'ve got no matter how much it takes." -Angelina Jolie.'}

Обратите внимание, что в моем словаре есть разрывы строк в них: \n

Как отобразить мой шаблон с этими разрывами строк?

{{цитаты | withlinebreaks\п}}

Ответы

Ответ 1

Используйте фильтр linebreaks.

Например:

{{ value|linebreaks }}

Если значение Joel\nis a slug, выход будет <p>Joel<br />is a slug</p>.