我想在我的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
,但是仍然得到了错误。在
如何调试这个?在
我通过将所有
'\'
更改为'/'
来解决我的问题。编辑:您可能需要检查以确保没有其他损坏。在
相关问题 更多 >
编程相关推荐