Replaced command-line uwsgi wrapper in the backend.http docs with gunicorn

gunicorn makes it easier to set up a uWSGI wrapper
around the web application, and it's easier to
install and document than handling uwsgi as an
external system dependency.
This commit is contained in:
Fabio Manganiello 2021-12-11 22:44:00 +01:00
parent 20fc3d91fc
commit fa708663e1
Signed by: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 13 additions and 13 deletions

View file

@ -155,19 +155,20 @@ class HttpBackend(Backend):
* **bcrypt** (``pip install bcrypt``)
* **magic** (``pip install python-magic``), optional, for MIME type
support if you want to enable media streaming
* **uwsgi** (``pip install uwsgi`` plus uwsgi server installed on your
system if required) - optional but recommended. By default the
Platypush web server will run in a process spawned on the fly by
the HTTP backend. However, being a Flask app, it will serve clients
in a single thread and won't support many features of a full-blown
web server.
* **gunicorn** (``pip install gunicorn``) - optional but recommended.
Base command to run the web server over uwsgi::
By default the Platypush web server will run in a
process spawned on the fly by the HTTP backend. However, being a
Flask app, it will serve clients in a single thread and it won't
support many features of a full-blown web server. gunicorn allows
you to easily spawn the web server in a uWSGI wrapper, separate
from the main Platypush daemon, and the uWSGI layer can be easily
exposed over an nginx/lighttpd web server.
uwsgi --http :8008 --module platypush.backend.http.uwsgi --master --processes 4 --threads 4
Command to run the web server over a gunicorn uWSGI wrapper::
gunicorn -w <n_workers> -b <bind_address>:8008 platypush.backend.http.uwsgi
Bear in mind that the main webapp is defined in ``platypush.backend.http.app:application``
and the WSGI startup script is stored under ``platypush/backend/http/uwsgi.py``.
"""
_DEFAULT_HTTP_PORT = 8008

View file

@ -5,5 +5,6 @@ manifest:
- flask
- bcrypt
- python-magic
- gunicorn
package: platypush.backend.http
type: backend

View file

@ -78,9 +78,7 @@ setup(
# Support for Pushbullet backend and plugin
'pushbullet': ['pushbullet.py @ https://github.com/rbrcsk/pushbullet.py/tarball/master'],
# Support for HTTP backend
'http': ['flask', 'bcrypt', 'python-magic'],
# Support for uWSGI HTTP backend
'uwsgi': ['flask', 'uwsgi', 'bcrypt', 'python-magic'],
'http': ['flask', 'bcrypt', 'python-magic', 'gunicorn'],
# Support for MQTT backends
'mqtt': ['paho-mqtt'],
# Support for RSS feeds parser