Configured to run behind reverse proxy, using Gunicorn

This commit is contained in:
Punnamaraju Vinayaka Tejas 2023-07-12 12:47:01 +05:30
parent c7df4ad6dc
commit f52d98333e
3 changed files with 9 additions and 3 deletions

View file

@ -1,11 +1,11 @@
## Development
From the root directory, run `pip install -r requirements.txt` to install the package (and all dependencies) in editable mode.
Use `flask --app flaskr run` to run app. The package will be updated as you edit files.
Use `gunicorn -w 2 'flaskr:create_app()'` to run app. Increase the number of workers using the `-w` argument if desired. The package will be updated as you edit files.
## Production
Run `python -m build --wheel` to generate the wheel, and install the wheel (found in `dist/`) in the production environment.
Use `flask --app flaskr run` to run app. To update package, you will need to install a new wheel.
Use `gunicorn -w 2 'flaskr:create_app()'` to run app. Increase the number of workers using the `-w` argument if desired. To update package, you will need to install a new wheel.
## Initializing database
The first time you install the app in each environment, you need to initialize database using `flask --app flaskr init-db`. This only needs to be run once per environment, and **will delete existing database if run again**.