forked from platypush/platypush
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:
parent
20fc3d91fc
commit
fa708663e1
3 changed files with 13 additions and 13 deletions
|
@ -155,19 +155,20 @@ class HttpBackend(Backend):
|
||||||
* **bcrypt** (``pip install bcrypt``)
|
* **bcrypt** (``pip install bcrypt``)
|
||||||
* **magic** (``pip install python-magic``), optional, for MIME type
|
* **magic** (``pip install python-magic``), optional, for MIME type
|
||||||
support if you want to enable media streaming
|
support if you want to enable media streaming
|
||||||
* **uwsgi** (``pip install uwsgi`` plus uwsgi server installed on your
|
* **gunicorn** (``pip install gunicorn``) - optional but recommended.
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
_DEFAULT_HTTP_PORT = 8008
|
||||||
|
|
|
@ -5,5 +5,6 @@ manifest:
|
||||||
- flask
|
- flask
|
||||||
- bcrypt
|
- bcrypt
|
||||||
- python-magic
|
- python-magic
|
||||||
|
- gunicorn
|
||||||
package: platypush.backend.http
|
package: platypush.backend.http
|
||||||
type: backend
|
type: backend
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -78,9 +78,7 @@ setup(
|
||||||
# Support for Pushbullet backend and plugin
|
# Support for Pushbullet backend and plugin
|
||||||
'pushbullet': ['pushbullet.py @ https://github.com/rbrcsk/pushbullet.py/tarball/master'],
|
'pushbullet': ['pushbullet.py @ https://github.com/rbrcsk/pushbullet.py/tarball/master'],
|
||||||
# Support for HTTP backend
|
# Support for HTTP backend
|
||||||
'http': ['flask', 'bcrypt', 'python-magic'],
|
'http': ['flask', 'bcrypt', 'python-magic', 'gunicorn'],
|
||||||
# Support for uWSGI HTTP backend
|
|
||||||
'uwsgi': ['flask', 'uwsgi', 'bcrypt', 'python-magic'],
|
|
||||||
# Support for MQTT backends
|
# Support for MQTT backends
|
||||||
'mqtt': ['paho-mqtt'],
|
'mqtt': ['paho-mqtt'],
|
||||||
# Support for RSS feeds parser
|
# Support for RSS feeds parser
|
||||||
|
|
Loading…
Reference in a new issue