From e9eee7a80d4703a75d0b529daeaec8d9ba341da8 Mon Sep 17 00:00:00 2001 From: Dylan DiGeronimo Date: Sat, 26 Oct 2019 14:33:13 -0400 Subject: [PATCH] Added instructions to run gunicorn server --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index acdb386..f5d91c3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Forked from Sean Redmond's [original protype](https://github.com/seanredmond/cce ## Setting up the virtual environment -Using a virtual environment is very important for ensuring that all work is done in a standardized Python environment. This is a quick and dirty guide to working with the virtual environment, for a more detailed guide, read [this](https://docs.python.org/3.7/tutorial/venv.html). +Using a virtual environment is very important for ensuring that all work is done in a standardized Python environment. This is a quick and dirty guide to working with the virtual environment. For a more detailed guide, read [this](https://docs.python.org/3.7/tutorial/venv.html). *Note: these commands all assume your system refers to your Python 3 installation as `python3`. On your system it may be different. You should confirm this before you try these commands.* @@ -49,4 +49,18 @@ After activation, your shell prompt should change to reflect the environment you **Always do this when you're finished working, otherwise your other Python work will screw up the project!** -`deactivate` \ No newline at end of file +`deactivate` + +## Deploying the project locally + +After activating the virtual environment, run the following command from within the root directory of the project: + +`gunicorn -w=4 wsgi:app` + +This will run the Flask application on a Gunicorn WSGI server. You can then go to [localhost:8080](localhost:8080) to use the application. + +To close the application, end the process with `ctrl-c` in your terminal. + +**TODO:** +* Update Gunicorn config file to automatically specify number of worker processes +* Use nginx to keep Gunicorn behind proxy server, as seen [here](https://gunicorn.org/#deployment) \ No newline at end of file