2018-10-16 09:55:05 +02:00
|
|
|
# gunicorn
|
|
|
|
|
|
|
|
> Python WSGI HTTP Server.
|
2025-04-25 14:45:48 +03:00
|
|
|
> More information: <https://docs.gunicorn.org/en/latest/run.html>.
|
2018-10-16 09:55:05 +02:00
|
|
|
|
|
|
|
- Run Python web app:
|
|
|
|
|
|
|
|
`gunicorn {{import.path:app_object}}`
|
|
|
|
|
|
|
|
- Listen on port 8080 on localhost:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`gunicorn {{[-b|--bind]}} {{localhost}}:{{8080}} {{import.path:app_object}}`
|
2018-10-16 09:55:05 +02:00
|
|
|
|
|
|
|
- Turn on live reload:
|
|
|
|
|
|
|
|
`gunicorn --reload {{import.path:app_object}}`
|
|
|
|
|
|
|
|
- Use 4 worker processes for handling requests:
|
|
|
|
|
2025-04-25 14:45:48 +03:00
|
|
|
`gunicorn {{[-w|--workers]}} {{4}} {{import.path:app_object}}`
|
2018-10-16 09:55:05 +02:00
|
|
|
|
|
|
|
- Use 4 worker threads for handling requests:
|
|
|
|
|
|
|
|
`gunicorn --threads {{4}} {{import.path:app_object}}`
|
|
|
|
|
|
|
|
- Run app over HTTPS:
|
|
|
|
|
|
|
|
`gunicorn --certfile {{cert.pem}} --keyfile {{key.pem}} {{import.path:app_object}}`
|