请问django的template
要如何单独拿来用
我刚刚试了一个exsample
from django import template
t = template.Template('My name is {{ name }}.')
c = template.Context({'name': 'Adrian'})
print(t.render(c))
出现一些错误讯息
django.core.exceptions.ImproperlyConfigured: Requested setting
TEMPLATE_DEBUG, but settings are not configured. You must either define the
environment variable DJANGO_SETTINGS_MODULE or call settings.configure()
before accessing settings.
大概就是要设环境之类的
但我整个程式又不想有多的设定档或py档
如果很麻烦我就安装其他单纯是模板的lib好了
谢谢