【发布时间】:2010-12-29 17:59:22
【问题描述】:
我正在使用获取模板的路径
paymenthtml = os.path.join(os.path.dirname(__file__), 'template\\payment.html')
并在另一个应用程序中调用它 paymenthtml 被复制到 payment_template
return render_to_response(self.payment_template, self.context, RequestContext(self.request))
但我得到错误
TemplateDoesNotExist at /test-payment-url/
E:\testapp\template\payment.html
为什么会出现错误?
编辑:我在 settings.py 中进行了以下更改,它能够找到模板,但我无法在生产中对路径进行硬编码,有什么线索吗?
TEMPLATE_DIRS = ("E:/testapp" )
【问题讨论】:
标签: python django django-templates