SSI标记不工作。[无权包含文件]

2024-05-19 17:06:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在我的html页面中包含一个static html,方法是给出绝对路径。我尝试使用ssi那个。那个代码是:

在设置.py公司名称:

...
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
from os.path import join
TEMPLATE_DIRS = ['c:\bunker\st\static\appcache',]
ALLOWED_INCLUDE_ROOTS =[(os.path.join(BASE_DIR, 'static/appcache')),] #For access permissions
...

在视图.py公司名称:

^{pr2}$

在网址.py公司名称:

url(r'^apps/','sp.views.home'),  #sp is app name

a.html:

{% ssi 'C:\bunker\st\static\appcache\index.html' parsed %}

但我从输出中得到以下结果

[Didn't have permission to include file]

我已经添加了ALLOWED_INCLUDE_ROOTS,但是仍然得到了错误。在

如何调试这个?在


Tags: pathpy名称baseoshtmldir公司