由于谷歌已弃用谷歌数据列表API,因此我们可以将"Google Drive API"用于Google云端硬盘,但谷歌网站呢?我目前正在使用Google.Gdata.client.dll引用与Google协作平台合作.
我正在使用带有Python/Jinja2的Google App Engine
我有几个html内容文件,如content1.html,content2.html和content3.html.他们每个人都需要扩展一个名为base.html的基本html文件.
假设这4个文件在某个文件夹中,那么在内容文件的开头,我只需要放置{%extends"base.html"%},并且html文件渲染得很好.
但是,随着项目的增长,已经创建了越来越多的页面.我想通过创建子文件夹来组织文件.所以现在假设在根目录中,我有base.html和subfolder1.在子文件夹1中,我有content1.html.
在我的python中:
JINJA_ENVIRONMENT = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(os.path.dirname(__file__))+"\\subfolder1"))
template = JINJA_ENVIRONMENT.get_template("content1.html")
template.render({})
Run Code Online (Sandbox Code Playgroud)
要么
JINJA_ENVIRONMENT = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(os.path.dirname(__file__))))
template = JINJA_ENVIRONMENT.get_template("subfolder1\\content1.html")
template.render({})
Run Code Online (Sandbox Code Playgroud)
但是在content1.html中,
{% extends "????????" %}
Run Code Online (Sandbox Code Playgroud)
什么应该放在问号上以扩展父文件夹中的base.html?