Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django render template within a template

Tags:

python

django

I want to create a template for a component that is used many times on a single page, with very few changes (simply 2 or 3 variables). How can I create this template and render it within another template?

like image 369
LordZardeck Avatar asked Apr 11 '12 01:04

LordZardeck


1 Answers

How about include?

Like so:

{% include "name_snippet.html" with person="Jane" greeting="Hello" %}
like image 166
neoascetic Avatar answered Oct 18 '22 01:10

neoascetic