【问题标题】:How to run webapp2(appengine) in Heroku?如何在 Heroku 中运行 webapp2(appengine)?
【发布时间】:2013-07-24 16:45:31
【问题描述】:

这是我的项目文件

过程文件

web: python main.py

requirement.txt

webapp2==2.3

main.py

import webapp2

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.write("hello")


app = webapp2.WSGIApplication([
    ('/', MainHandler)
], debug=True)

heroku 仍然会发出应用程序错误

我的项目有什么问题?

【问题讨论】:

    标签: python google-app-engine heroku webapp2


    【解决方案1】:

    根据他们的 python 入门,您似乎需要 gunicorn 网络服务器。尝试在您的 requirements.txt 和 procfile web 中添加 gunicorn:gunicorn main:app

    忘记添加链接: https://devcenter.heroku.com/articles/python

    这也是我的 webapp2-starter,它被设置为像 appengine 开发服务器一样工作,但在 app engine 之外工作。 https://github.com/faisalraja/webapp2-starter

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-24
      • 1970-01-01
      • 1970-01-01
      • 2013-08-22
      • 1970-01-01
      • 2014-04-21
      • 2018-10-01
      • 2012-01-18
      相关资源
      最近更新 更多