Added instructions to run gunicorn server

pull/1/head
Dylan DiGeronimo 2019-10-26 14:33:13 -04:00
parent 226a0765a4
commit e9eee7a80d
1 changed files with 16 additions and 2 deletions

View File

@ -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`
`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)