【发布时间】:2014-10-10 08:39:24
【问题描述】:
我正在尝试创建登录和个人资料页面。这是适用于“/”和“/(任何)”的 app.yaml 文件。而不是 '/(anything)' 我希望路径为 '/user/.*'。我尝试了很多,但它只呈现页面的 html 部分。如何配置我的 app.yaml,使其以完整的 CSS 和 JS 呈现并适用于“/(anything)/(anything)”?
application: My-App-name
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.css)
mime_type: text/css
static_files: static/\1
upload: static/(.*\.css)
- url: /(.*\.html)
mime_type: text/html
static_files: static/\1
upload: static/(.*\.html)
- url: /(.*\.js)
mime_type: text/javascript
static_files: static/\1
upload: static/(.*\.js)
image files
- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/\1
upload: static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
# index files
- url: /(.+)/
static_files: static/\1/index.html
upload: static/(.+)/index.html
# site root
- url: /.*
script: main.app
#- url: /user/.*
# script: main.app
libraries:
- name: jinja2
version: latest
PS:我的文件夹树为,
app.yaml
静态->CSS、JS、图片、html文件
index.yaml 主应用程序
【问题讨论】:
标签: google-app-engine python-2.7 app.yaml