首页 > 解决方案 > Django 模板过滤器

问题描述

我应该在 django 模板中使用哪个过滤器,以便以输入的方式显示我的文本,包括所有空格甚至对齐方式(无论是左、右等)例如:我想添加一些关于标题的描述,我想要它是这种形式:

"My my, 2018 is going by so quickly! 

Maybe it went by fast because we were too busy loading up on all kinds of yummy food at all the new restaurants that opened up.
                    As usual, we took the liberty of curating a list of eateries that we think                      you should not keep waiting.


So, without much further adieu, there’s your Culinary Bucket List For The Rest Of 2018".

目前我的标题描述设置为这种格式:{{value:Linebreaks}}

标签: django

解决方案


使用内置的 {{value | 安全的}}


推荐阅读