有没有办法从具有配置后端的字符串创建django模板?

时间:2016-12-30 13:40:51

标签: python django python-2.7 django-templates

django新手,我从字符串中加载模板,

from django.conf import settings
from django.template import Template, Context

settings.configure()
a= Template(template_variable)

但获得例外:

"No DjangoTemplates backend is configured.")
ImproperlyConfigured: No DjangoTemplates backend is configured.

0 个答案:

没有答案