0

I have simply copy pasted the default program from python for heroku;

import os
from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello World!'

run(host='localhost', port=8080)

it returns an error "exited with status 0", which after research i have found out to mean "exitted succesfully". How do i fix this as the website is giving the error ". It returns no other traceback error.

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.
4

1 回答 1

0

我想你已经在你自己的评论中回答了你的问题。

在 Heroku 上,Flask 应用程序似乎不是使用 Flask/werkzeug 应用程序运行器运行的,而是通过 gunicorn 运行的,所以转到教程,向上滚动一点以查看确切的示例(没有run()一行),然后查看调用通过包含web: gunicorn hello:app.

hello这里指的是你的 hello.py,以及app里面的变量 app。

于 2013-07-23T13:36:26.970 回答