Added instructions to run gunicorn server
parent
226a0765a4
commit
e9eee7a80d
18
README.md
18
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`
|
||||
`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)
|
Loading…
Reference in New Issue