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' ,
...
]完整的文檔可以在拖鞋文檔網站上找到。
麻省理工學院