我遇到了与我的Python App Engine Web应用程序的app.yaml
设置有关的问题。不知怎的,除了我的应用程序中的index.html静态文件(javascript,CSS和HTML)其余部分没有部署到应用程序引擎。我在app.yaml
的脚本下试过static_files
和upload
元素的各种组合。尽管它们中的一些适用于本地开发应用程序服务器,但通过gcloud app deploy
在应用程序引擎上部署时,它们不起作用。由gcloud生成的日志不会显示任何错误。他们显示所有静态文件的“跳过[...]上传”等DEBUG消息。应用程序(它是一个AngularJS应用程序)的用于上传静态文件的app.yaml设置
目录结构如下:
<APP ROOT>
├── app.yaml
├── my_scripts
│ ├── foo.py
│ └── ...
├── index.html
├── mainapp.py
└── web
├── assets
│ ├── css
│ │ ├── bootstrap.min.css
│ │ ├── bootstrap-theme.min.css
│ │ ├── ....
│ │ └── ....
│ └── js
│ ├── app
│ │ ├── app.js
│ │ └── ....
│ └── lib
│ └── ...
└── partials
├── login.html
└── ...
以下是我的应用程序的app.yml文件。
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /(user|tasks)/.*
script: mainapp.app
- url:/
static_files: index.html
upload: index.html
- url: /web
static_files: web\/[^\n]*
upload: web\/[^\n]*
- url: /web
static_dir: web
任何指针来帮助我解决这个问题将不胜感激。
看看在http:// stackoverflow.com/questions/33447890/static-files-are-missing/33448239#33448239。查看解决该问题是否有助于在部署期间跳过静态文件。顺便说一句 - 有什么理由跳过它们显示在任何地方? –