From: gregor herrmann Date: Thu, 23 Aug 2018 14:32:41 +0000 (+0200) Subject: add notes about waitress to README X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/a61d8c6406e1a7724c8c55e96f0e372eaea86b20 add notes about waitress to README --- diff --git a/web/README b/web/README index d23bdc8..2b6b555 100644 --- a/web/README +++ b/web/README @@ -14,3 +14,47 @@ Go to: http://127.0.0.1:5000/ or http://:5000/ if the app is running on a different machine + +--- + +notes on a "production" server: + +needed: python3-waitress + +version 1: + +1) add to web/seepark_web.py: +from waitress import serve + +if __name__ == "__main__": + #app.run() + serve(app, listen='*:5000') + +2) run: +SEEPARKINI=~/seewasser.ini python3 web/seepark_web.py + +version 2: + +1) +touch web/__init__.py + +2) +add to web/seepark_web.py: +def create_app(): + return app + +3) +run: +SEEPARKINI=~/seewasser.ini waitress-serve --port 8765 --call 'web.seepark_web:create_app' + + +links: + +http://flask.pocoo.org/docs/1.0/tutorial/deploy/ +http://flask.pocoo.org/docs/1.0/tutorial/factory/ +https://github.com/pallets/flask/blob/1.0.2/examples/tutorial/flaskr/__init__.py + +https://docs.pylonsproject.org/projects/waitress/en/latest/ +https://docs.pylonsproject.org/projects/waitress/en/latest/runner.html#runner + +https://gr33ndata.blogspot.com/2012/01/waitress-flask.html