Template.render(context)
[source]
Call the Template
object’s render()
method with a Context
to “fill” the template:
1 2 3 4 5 6 7 8 9 10 | >>> from django.template import Context, Template >>> template = Template( "My name is {{ my_name }}." ) >>> context = Context({ "my_name" : "Adrian" }) >>> template.render(context) "My name is Adrian." >>> context = Context({ "my_name" : "Dolores" }) >>> template.render(context) "My name is Dolores." |
Please login to continue.