Django

Code

Ticket #152 (closed: duplicate)

Opened 5 years ago

Last modified 3 years ago

FCGI server for django

Reported by: gb@bofh.ms Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

django-fcgi.py (4.5 kB) - added by hugo <gb@bofh.ms> on 07/27/05 05:35:50.
FCGI server script

Change History

07/26/05 05:02:32 changed by hugo <gb@bofh.ms>

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).

07/27/05 05:35:50 changed by hugo <gb@bofh.ms>

  • attachment django-fcgi.py added.

FCGI server script

07/27/05 05:41:13 changed by hugo <gb@bofh.ms>

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.

07/27/05 06:26:06 changed by hugo <gb@bofh.ms>

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.

10/06/05 12:23:06 changed by hugo

The most current scripts are in my repository.

05/04/06 23:04:48 changed by adrian

  • status changed from new to closed.
  • resolution set to duplicate.

Superceded by #1736.

06/12/06 05:47:10 changed by Home

  • type deleted.

Add/Change #152 (FCGI server for django)




Change Properties
Action