from django.template import Context,Template

>>> python manange.py shell (进入该django项目的环境)

>>> from django.template import Context, Template

>>> t = Template('My name is {{ name }}.')

>>> c = Context({'name': 'Gregory'})

>>> t.render(c)

'My name is Gregory.'

你可能感兴趣的:(from django.template import Context,Template)