谷歌应用程序引擎部署瓶子应用程序出现问题 [英] problems deploying bottle application with google app engine
问题描述
新手在这里 - 我一直在尝试用谷歌应用程序引擎在瓶子里创建一个Hello World。我得到了hello world部分来显示,但即使在索引页上,我也会得到以下输出:Hello world!状态:500
如果我尝试添加新路由'/ page'route),然后我导航到新的路由,我得到服务器错误:网站在检索时遇到错误...可能是维护或配置不正确。在导航到配置不当的页面后,如果我尝试返回到/,我还会收到服务器错误。我已经将bottle.py放在我的根目录中。有人可以帮助我正确配置我的文件吗?
从瓶子导入瓶子
import route,template,request,error,debug
@route('/')
def index():
返回Hello World!
@route('/ page')
def page():
返回'page!'
bottle.debug(True)
bottle.run(server ='gae')
这可能有助于:
app.yaml:
application: my-app
版本:1
运行时:python27
api_version:1
线程安全:是
$ b $ - url:。*
脚本: main.app
main.py:
进口瓶
@ bottle.route('/')
def root():
返回'hello!'
bottle.run(server ='gae',debug = True)
app = bottle.app()
以下是GitHub的原始答案。
https://github.com/defnull/bottle/issues/401
newbie here--I've been trying to create a "Hello World" in bottle using google app engine. I got the "hello world" part to show up, but even on on index page, I get the following output: "Hello world!Status: 500"
If I try to add new routes (like the '/page' route), and I navigate to the new route, I get "Server error: The website encountered an error while retrieving... It may be down for maintenance or configured incorrectly." After I navigate to the improperly configured page, if I try to go back to '/', I will also receive a server error. I have placed bottle.py in my root directory. Could someone please help me to configure my file properly? Thanks!
import bottle
from bottle import route, template, request, error, debug
@route('/')
def index():
return "Hello World!"
@route('/page')
def page():
return 'page!'
bottle.debug(True)
bottle.run(server='gae')
This might help:
app.yaml:
application: my-app
version: 1
runtime: python27
api_version: 1
threadsafe: yes
- url: .*
script: main.app
main.py:
import bottle
@bottle.route('/')
def root():
return 'hello!'
bottle.run(server='gae', debug=True)
app = bottle.app()
Here's the original answer from GitHub. https://github.com/defnull/bottle/issues/401
这篇关于谷歌应用程序引擎部署瓶子应用程序出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!