They both let you stick some mako-rendered content into another one. Both let you pass in arguments.
Is there a performance difference between the two? A philosophical one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Def is for defining functions in the template, while include executes another file.
The mako documentation summarizes thus:
(from http://docs.makotemplates.org/en/latest/defs.html)
Of course,
<%include>involves another file, you can call a<%def>from the same file it is defined in.