From dc73be88111183f767f1ec6fa210201222bced45 Mon Sep 17 00:00:00 2001 From: Castro0o Date: Tue, 9 Jun 2020 17:20:25 +0200 Subject: [PATCH] Read me with gunicorn -env SCRIPT_NAME=/watermarks - now for REAL --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ddc9b30..cbeab41 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ **Using gunicorn:** -`gunicorn -w 4 -b 127.0.0.1:5000 app:app` +`gunicorn --env SCRIPT_NAME=/watermarks -w 4 -b 127.0.0.1:5000 app:app --log-level debug` * `-w` workers * `-b` bind to address / unix socker **And gunicorn with using unix sock:** (this how it should run in production) -`gunicorn --workers 4 --bind unix:app.sock -m 007 app:app ` +` gunicorn --env SCRIPT_NAME=/watermarks --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug ## in Production with gunicorn and unix sockets Based on https://medium.com/faun/deploy-flask-app-with-nginx-using-gunicorn-7fda4f50066a @@ -72,4 +72,18 @@ And reloading the services and the start following app.log: `tail -f /var/www/TacticalApp/app.log` -But in the long run logging should be disabled \ No newline at end of file +But in the long run logging should be disabled + +---- +09.06.2020 Handling url path /watermarks + +* gunicorn has to be started with argument `--env SCRIPT_NAME=/watermarks` which defines its path: +`gunicorn --env SCRIPT_NAME=/watermarks --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug` + * allows for the following URLs + * http://127.0.0.1/watermarks + * http://127.0.0.1/watermarks/uploadbook + * http://127.0.0.1/watermarks/about + +* added pages /test and + +* make urls relative