python - Heroku Flask Tutorial Procfile Meaning -
in heroku tutorial, there piece of code
hello.py
import os flask import flask app = flask(__name__) @app.route('/') def hello(): return 'hello world!'
and procfile:
web: gunicorn hello:app --log-file=-
the part that's confusing hello:app
part; hello
refer hello()
function or hello.py script? depending on meaning of that, whole procfile statement mean?
the procfile contains command line starting application on heroku. full documentation can found here: https://devcenter.heroku.com/articles/procfile
in case telling heroku use app variable (your constructed flask app) in hello module gunicorn , start web process (one can handle http requests). there other process types can specify such background workers.
your flask application object wsgi application, , can run using wsgi server. gunicorn 1 of choices on heroku.
Comments
Post a Comment