django-custom-tags

    -5熱度

    1回答

    請用django自定義標籤幫助。請分析它! 理念: 在任何模板(父母或子女),我們安裝一個標記{{無繩「頭」}},有一個名字,比如推杆可能不止一個。 在另一邊,我們有阻止此塊 {{ teleputter "head" "unique-name" }} some html {{ teleputterend }} 內容去與適當的無繩名無繩。

    0熱度

    2回答

    我想在django中編寫自定義inclusion_tag。 繼http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ 的例子,我只是寫 @register.inclusion_tag('test.html') 這裏的test.html在同一目錄(應用程序/程序my_app/templatetags)的文件作爲其定義.py