$ ls ~yifei/notes/

django templates

Posted on:

Last modified:

marco

  there is no marco in django template, you just have to use include with parameters

{% include "marco.html" with arg=parameter %}

variable

{{ my_dict.key }}
{{ my_object.attribute }}
{{ my_list.0 }}

If a variable resolves to a callable, the template system will call it with no arguments and use its result instead of the callable.

© 2016-2022 Yifei Kong. Powered by ynotes

All contents are under the CC-BY-NC-SA license, if not otherwise specified.

Opinions expressed here are solely my own and do not express the views or opinions of my employer.