請問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好了
謝謝