【发布时间】:2015-05-29 22:32:26
【问题描述】:
我只想知道,如何让 test.html(静态文件夹中的一个文件,在前端包中)显示出来?
我将它的处理程序放在 include.yaml 文件中(静态文件夹外的文件),并在 app.yaml 文件的包含下列出了前端(前端包外的文件)
我的目录如下所示:
frontend (package)
handlers (package in frontend)
__init__.py (file in handlers)
sass (folder in frontend)
static (folder in frontend)
test.html (file in static)
__init__.py (file in frontend)
include.yaml(file in frontend)
app.yaml (file not in frontend)
//=================================
我的 include.yaml(在前端包中)看起来像这样(是的,所有内容都被注释掉了,因为我没有尝试任何工作):
handlers:
#- url: /frontend/static
# static_dir: frontend/static ### this works in app.yaml, but does not work in this file
#- url: /static
# static_dir: static ### doesn't work in this file
#- url: /frontend/static
# static_dir: frontend.static ### doesn't work in this file
#- url: /frontend/static
# static_dir: /frontend/static ### this does not work in app.yaml, or in this file
//=============================================== ==
我的 app.yaml 文件(不在前端包中,与其同级)如下所示:
application: edev
version: 1
runtime: python27
api_version: 1
threadsafe: true
includes:
- frontend
#- frontend_admin
#- api
#- mapreduce
handlers:
#- url: /frontend/static
# static_dir: frontend/static ### this works in app.yaml
#- url: /frontend/static
# static_dir: /frontend/static ### this does not work in app.yaml
#- url: /
# script: main.app
#- url: /_ah/warmup
# script: warmup.application
#- url: /.*
# script: main.app
builtins:
- remote_api: on
inbound_services:
- warmup
#skip_files:
#- ^(.*/)?#.*#$
#- ^(.*/)?.*~$
#- ^(.*/)?.*\.py[co]$
#- ^(.*/)?.*/RCS/.*$
#- ^(.*/)?\..*$
#- tools.*
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: latest
想法?
【问题讨论】:
标签: google-app-engine include yaml pydev handlers