from django.conf import settingsfrom django import template
settings.configure()
a = template.Template(‘My name is {{ name }}.‘)
b = template.Context({"name":"xiaol"})
print a.render(b)
Django在不启动server的情况下调用方法
原文:http://www.cnblogs.com/413xiaol/p/6854396.html