From 079d1a04da63ebdad456d0912a42f201acbe302c Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Wed, 2 Feb 2022 12:40:41 +0100 Subject: [PATCH] Add 'deploy' section to README --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 815d8cc..e6d7da2 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,35 @@ Configuration is read from environment variables: - `LW_COLLECTION_PATH` : path to the collection folder. If not set, an error is raised. - `LW_PAGE_SIZE` : how many entries show per page in list. Defaults to `20`. +## Deploy + +Lesana Web is built on [Flask](https://flask.palletsprojects.com/en/2.0.x/) framework and +talks with webserver using [WSGI](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) +protocol. + +Details on how to setup WSGI depends on your webserver. Usually it needs a `.wsgi` file, +wich is not distribuited with the code, and you need to write it. + +If Lesana Web is in your `PYTHONPATH` , the `.wsgi` file is just: + +```python +from lesanaweb import app as application +``` + +Config environment variables should be set in your WSGI configuration. + +Alternatively, python import path and/or environment variables can be set directly in the `.wsgi` file: + +```python +import sys, os + +os.environ['LW_COLLECTION_PATH'] = "/path/to/lesana/collection" + +sys.path.insert(0, '/path/where/lesanaweb/is/located') + +from lesanaweb import app as application +``` + ## Templates Lesana Web uses three templates, written using [Jinja2](https://jinja.palletsprojects.com/) -- 2.34.4