slippers
0.6.2
在django中构建可重复使用的组件,而无需编写一行Python。
{% # quote %}
{% quote_photo src = "/project-hail-mary.jpg" %}
{% # quote_text %}
“I penetrated the outer cell membrane with a nanosyringe."
"You poked it with a stick?"
"No!" I said. "Well. Yes. But it was a scientific poke
with a very scientific stick.”
{% / quote_text %}
{% # quote_attribution %}
Andy Weir, Project Hail Mary
{% / quote_attribution %}
{% / quote %} Django模板语言很棒。它很快,富含功能,而且总体上很棒。
拖鞋的目标是增加DTL,增加了足够的功能,使建筑界面更加舒适。
它包括其他模板标签和过滤器,但其标题功能是可重复使用的组件。
{% # button variant = "primary" %} See how it works {% / button %}看看它的工作方式
pip install slippers
将其添加到您的INSTALLED_APPS :
INSTALLED_APPS = [
...
'slippers' ,
...
]完整的文档可以在拖鞋文档网站上找到。
麻省理工学院