Verified Commit fa708663 authored by Fabio Manganiello's avatar Fabio Manganiello
Browse files

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.
parent 20fc3d91
Pipeline #123 passed with stages
in 5 minutes and 59 seconds
......@@ -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
......
......@@ -5,5 +5,6 @@ manifest:
- flask
- bcrypt
- python-magic
- gunicorn
package: platypush.backend.http
type: backend
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment