Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Heroku中运行webapp2(appengine)?_Python_Google App Engine_Heroku_Webapp2 - Fatal编程技术网

Python 如何在Heroku中运行webapp2(appengine)?

Python 如何在Heroku中运行webapp2(appengine)?,python,google-app-engine,heroku,webapp2,Python,Google App Engine,Heroku,Webapp2,这是我的项目文件 程序文件 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) ], de

这是我的项目文件

程序文件

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的入门,您似乎需要gunicorn web服务器。尝试在requirements.txt和procfile web:gunicorn main:app中添加gunicorn

忘记添加链接:

这也是我的webapp2入门版,它的设置类似于appengine开发服务器,但在appengine之外工作。