【问题标题】:Deploying jQuery Mobile app to Google App Engine将 jQuery Mobile 应用程序部署到 Google App Engine
【发布时间】:2014-07-27 04:02:55
【问题描述】:

我使用PyCharm创建了一个应用程序,项目目录由以下内容组成:

My Project
 ______main.py
 ______app.yaml
 ______templates
 ______html
          _____js
                __________profilePage.js
                __________other .js files
          _____images
          _____css
          _____index.html
          _____profilePage.html

还有app.yaml:

application: my app id
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /js/(.*\.js)
  mime_type: application/javascript
  static_files: js/\1
  upload: js/(.*\.js)

- url: /images
  static_dir: images

- url: .*
  script: main.app

- url: /css
  static_dir: css

- url: /html
  static_dir: html

libraries:
- name: webapp2
 version: "2.5.2"

我尝试使用 Google App Engine Launcher 将应用程序部署到 Google 应用程序引擎并成功部署,但它重定向到我在 main.py 中的 MainHandler,我自定义设计为仅打印“hello world”。我如何获得我的应用程序改为显示 index.html 的内容?

【问题讨论】:

  • 如果不查看您的 app.yaml 的内容,我们将无法告诉您
  • 我现在才包括在内。

标签: jquery python google-app-engine jquery-mobile


【解决方案1】:

你的问题是

- url: .*
  script: main.app

捕捉所有到达它的东西。

将其移到列表下方。

app.yaml 处理程序处理是有序的。第一个匹配获得请求。

【讨论】:

    猜你喜欢
    • 2016-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-06
    • 1970-01-01
    • 1970-01-01
    • 2017-09-04
    • 1970-01-01
    相关资源
    最近更新 更多