Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#152 closed (duplicate)

FCGI server for django

Reported by: gb@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Maybe the FCGI-WSGI-Server at http://svn.saddi.com/py-lib/trunk/fcgi.py might be useable for django? A runfcgi command for django-admin might run along the following lines:

def runfcgi():
    "Starts a FCGI server for production use"
    from django.core.servers.fcgi import WSGIServer
    from django.core.handlers.wsgi import WSGIHandler
    WSGIServer(WSGIHandler()).run()
runfcgi.args = ''

Attachments (1)

django-fcgi.py (4.5 KB ) - added by hugo <gb@…> 19 years ago.
FCGI server script

Download all attachments as: .zip

Change History (7)

comment:1 by hugo <gb@…>, 19 years ago

I have written a short description on how to get Django running with FCGI at http://hugo.muensterland.org/2005/07/26/running-django-with-fcgi-and-lighttpd/. Please have a look and feel free to steal anything you need for your documentation :-)

It's only a first take but should be enough to get people up and running with lighttpd and so should give a nice alternative for mod_python (especially for people still running apache 1.3, since they can't run the needed mod_python version).

by hugo <gb@…>, 19 years ago

Attachment: django-fcgi.py added

FCGI server script

comment:2 by hugo <gb@…>, 19 years ago

I added a script that starts a django project setting as a remote FCGI server on either a socket or a ip:port. This can be used to run django projects under their own user ID behind a webserver that itself runs under different rights or could be used in conjunction with some dispatching tool for load balancing a django installation.

The script works fine with Python 2.4. But it uses the preforked FCGI server from Flup (to better make use of SMP machines - due to the GIL, python threading doesn't help there) and that one uses socketpair. So to get it working with Python 2.3 you additionally need the Eunuchs package, because Python 2.3 doesn't have socket.socketpair.

The two packages can be found here:

Flup: http://www.saddi.com/software/flup/

Eunuchs: http://www.inoi.fi/open/trac/eunuchs

Just start the django-fcgi.py without parameters to get a short help on what you can give as options.

comment:3 by hugo <gb@…>, 19 years ago

Ok, I have a documentation up how to use the script: http://hugo.muensterland.org/2005/07/27/django-lighttpd-and-fcgi-second-take/. This document goes into more detail and gives a much nicer configuration, I think.

comment:4 by hugo, 19 years ago

The most current scripts are in my repository.

comment:5 by Adrian Holovaty, 19 years ago

Resolution: duplicate
Status: newclosed

Superceded by #1736.

comment:6 by Home, 18 years ago

Type: defect
Note: See TracTickets for help on using tickets.
Back to Top