Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FastCGI WSGI library in Python 3?

Does there exist any library that can serve a WSGI application as a FastCGI server, for Python 3? (So that nginx could then proxy requests to it?)

The Python 3 docs mention flup, but flup doesn't even install in Python 3:

% env3/bin/pip install flup
Downloading/unpacking flup
  Downloading flup-1.0.2.tar.gz (49kB): 49kB downloaded
  Running setup.py (path:/Users/me/tmp/env3/build/flup/setup.py) egg_info for package flup
    Traceback (most recent call last):
      File "", line 17, in 
      File "/Users/me/tmp/env3/build/flup/setup.py", line 2, in 
        from ez_setup import use_setuptools
      File "./ez_setup.py", line 98
        except pkg_resources.VersionConflict, e:
                                            ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "", line 17, in 

  File "/Users/me/tmp/env3/build/flup/setup.py", line 2, in 

    from ez_setup import use_setuptools

  File "./ez_setup.py", line 98

    except pkg_resources.VersionConflict, e:

                                        ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in [snip]
Storing debug log for failure in [snip]
like image 493
Thanatos Avatar asked May 05 '14 21:05

Thanatos


3 Answers

There is now module called flup6. Install it using pip

./pip install flup6
like image 162
SaidbakR Avatar answered Nov 18 '22 06:11

SaidbakR


You can use flipflop. It's a simplified fork of flup (contains only the FastCGI part) and works fine with Python 3.

like image 39
msiemens Avatar answered Nov 18 '22 04:11

msiemens


You can use flup-py3 to solve this problem, as :

pip3 install flup-py3

You may need super user privilge to execute this command.

like image 22
yunfeng Avatar answered Nov 18 '22 05:11

yunfeng