From 65bc6f79f1b94659ddd39dbdeaf9e4c5ab88c474 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 15 Apr 2022 18:50:41 +0200 Subject: [PATCH] Fix the gunicorn command. --- README.md | 5 ++++- createdir.service | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce2a3f0..bbe6e13 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ We use it to create the users' home directory before trying the mount via autofs * Python 3.8+ * Flask 2.1 +* gunicorn ### Build the environment @@ -16,7 +17,7 @@ python3 -m venv venv pip install Flask ``` -### Run the service +### Test the service ``` shell source ./venv/bin/activate @@ -24,3 +25,5 @@ export FLASK_APP=dircreate export FLASK_ENV=development flask run ``` + +Use gunincorn when in production diff --git a/createdir.service b/createdir.service index cc73507..df5aaff 100644 --- a/createdir.service +++ b/createdir.service @@ -7,7 +7,7 @@ Environment=FLASK_CONFIG=production Environment=FLASK_APP=dircreate User=dircreate WorkingDirectory=/opt/dircreate -ExecStart=/opt/createdir/venv/bin/gunicorn -b localhost:5000 dircreate:app +ExecStart=/opt/createdir/venv/bin/gunicorn -b localhost:5000 "dircreate:create_app()" Restart=always [Install]