From 02bf0a0759ae04c069820212edb10b2c12c482a6 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Sun, 27 Jan 2019 18:20:50 +0300 Subject: [PATCH] docs: update deployment info for FastCGI --- docs/docs/extras/deployment.rst | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/docs/extras/deployment.rst b/docs/docs/extras/deployment.rst index b2c19e8..6f27095 100644 --- a/docs/docs/extras/deployment.rst +++ b/docs/docs/extras/deployment.rst @@ -196,6 +196,10 @@ directory. `mod_fastcgi `__ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +You can use this method if your hosting provider doesn't allow you to have long +running processes. If FastCGI has not yet been configured in your server, +please follow these steps: + .. note:: This information may be incorrect, if you have more knowledge on how to deploy Python via `mod_fastcgi`, consider extending/correcting this section. @@ -219,21 +223,30 @@ directory. -Next, copy'n'paste to `/var/www/isso.fcgi` (or whatever location you prefer): +Next, to run isso as a FastCGI script you'll need to install ``flup`` with +PIP: + +.. code-block:: sh + + $ pip install flup + +Finally, copy'n'paste to `/var/www/isso.fcgi` (or whatever location you prefer): .. code-block:: python #!/usr/bin/env python #: uncomment if you're using a virtualenv # import sys - # sys.insert(0, '/lib/python2.7/site-packages') + # sys.path.insert(0, '/lib/python2.7/site-packages') - from isso import make_app - from isso.core import Config + from isso import make_app, dist, config + import os from flup.server.fcgi import WSGIServer - application = make_app(Config.load("/path/to/isso.cfg")) + application = make_app(config.load( + os.path.join(dist.location, dist.project_name, "defaults.ini"), + "/path/to/isso.cfg")) WSGIServer(application).run() `Openshift `__