【发布时间】:2016-08-30 13:18:54
【问题描述】:
我正在尝试在 GAE 上部署一个烧瓶应用程序。
Flask、jinja2 等所有依赖项都在同一个目录中
当 GAE 启动器在本地部署应用程序时,它会被部署,但 一旦本地服务器启动并运行,主页 url 上不会显示任何内容,即使 main.py 为主页 url 返回了一些文本
以下是我的文件:
app.yaml
application: texsumm
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: .*
script: main.app
main.py
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def template_test():
return "Hello"
if __name__ == "__main__":
app.run()
可能是什么问题?
【问题讨论】:
-
你在哪里定义你的“home url”处理程序?堆栈跟踪中的任何内容?
-
@GAEfan ,"@app.route("/")" 行是 home url handler 吧??
-
你提到了一个“home url”和一个“base url”(你说的是“返回一些文本”)。如果你去根域(“/”),你看到“Hello”了吗?
-
对不起,我的意思是 base 和 home 都是一样的(编辑了问题)。如果我通过烧瓶(即 python main.py)运行本地服务器并显示“Hello”,它工作正常。但是当我使用 GAE 时,它只是以空白页面到达 localhost
-
应用日志中有任何内容吗?
标签: python google-app-engine web-applications flask