So I'm trying to host a python server on Heroku and I wasn't able to get it working, I have scaled to a basic hello world server for now just to get the errors out the way.
Initially, I was getting the error that Heroku could not allocate its own buildpack, so I manually added the python one, now the error is the python buildpack is not compatible with my app. Even though others have tornado working and it is pip installable
I have a basic directory with the only 1 python file (.git folder hidden)
Here is the code for the server:
import tornado.ioloop
import tornado.web
import os
port = int(os.getenv('PORT', 8080))
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app = make_app()
app.listen(port)
tornado.ioloop.IOLoop.current().start()
Any further clarifications/questions please let me know:) thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.