3👍
✅
To parse templates and check includes, i use this code:
ast = env.parse(template_text)
for each in meta.find_referenced_templates(ast) : # find the (% includes %}
Source:stackexchange.com