82
Based on the the docs for using the template system:
from django.template import Template, Context
t = Template("My name is {{ my_name }}.")
c = Context({"my_name": "Adrian"})
t.render(c)
- [Django]-Django 1.8 Run a specific migration
- [Django]-Django: How to get current user in admin forms?
- [Django]-Can a dictionary be passed to django models on create?
5
In Django < 1.8:
from django.template.loader import get_template_from_string
tpl = Template(get_template_from_string("My name is {{ my_name }}."))
- [Django]-How to use less css with django?
- [Django]-Django Serializer Method Field
- [Django]-Get request.session from a class-based generic view
Source:stackexchange.com