Skip to content

Commit

Permalink
Add gunicorn
Browse files Browse the repository at this point in the history
We're using gunicorn on production so I think it's reasonable to just
include it as a project dependency and provide direct instructions for
the user on how to use it in a production environment.

Issue #52
  • Loading branch information
slifty committed Jan 13, 2022
1 parent 5b32d3d commit bef55ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name = "pypi"
[packages]
flask = "*"
peewee = "*"
gunicorn = "*"

[dev-packages]

Expand Down
18 changes: 17 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ $ export FLASK_APP=pdc
$ pipenv run flask run
```


## Running on Production

This project has a WSGI entry point if you want to use something like [gunicorn](https://flask.palletsprojects.com/en/2.0.x/deploying/wsgi-standalone/#gunicorn).

Gunicorn has been added as a project dependency, and so you can run a production copy by typing:

```
$ pipenv run gunicorn --reload --bind 127.0.0.1:9090 wsgi:app
```

This could be set up using the process manager of your chice (e.g. [supervisord](http://supervisord.org/))

0 comments on commit bef55ae

Please sign in to comment.