Changeset 4902
- Timestamp:
- 04/01/07 02:30:27 (1 year ago)
- Files:
-
- django/trunk/django/core/servers/fastcgi.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/servers/fastcgi.py
r4265 r4902 1 1 """ 2 FastCGI server that implements the WSGI protocol.2 FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol. 3 3 4 4 Uses the flup python package: http://www.saddi.com/software/flup/ … … 19 19 20 20 FASTCGI_HELP = r"""runfcgi: 21 Run this project as a fastcgi application. To do this, the22 flup package from http://www.saddi.com/software/flup/ is23 required.21 Run this project as a fastcgi (or some other protocol supported 22 by flup) application. To do this, the flup package from 23 http://www.saddi.com/software/flup/ is required. 24 24 25 25 Usage: … … 28 28 29 29 Optional Fcgi settings: (setting=value) 30 protocol=PROTOCOL fcgi, scgi, ajp, ... (default fcgi) 30 31 host=HOSTNAME hostname to listen on.. 31 32 port=PORTNUM port to listen on. … … 46 47 $ manage.py runfcgi method=threaded 47 48 48 Run a fastcgi server on a TCP host/port49 $ manage.py runfcgi method=prefork host=127.0.0.1 port=802549 Run a scgi server on a TCP host/port 50 $ manage.py runfcgi protocol=scgi method=prefork host=127.0.0.1 port=8025 50 51 51 52 Run a fastcgi server on a UNIX domain socket (posix platforms only) … … 59 60 60 61 FASTCGI_OPTIONS = { 62 'protocol': 'fcgi', 61 63 'host': None, 62 64 'port': None, … … 101 103 return False 102 104 105 flup_module = 'server.' + options['protocol'] 106 103 107 if options['method'] in ('prefork', 'fork'): 104 from flup.server.fcgi_fork import WSGIServer105 108 wsgi_opts = { 106 109 'maxSpare': int(options["maxspare"]), … … 109 112 'maxRequests': int(options["maxrequests"]), 110 113 } 114 flup_module += '_fork' 111 115 elif options['method'] in ('thread', 'threaded'): 112 from flup.server.fcgi import WSGIServer113 116 wsgi_opts = { 114 117 'maxSpare': int(options["maxspare"]), … … 120 123 121 124 wsgi_opts['debug'] = False # Turn off flup tracebacks 125 126 try: 127 WSGIServer = getattr(__import__('flup.' + flup_module, '', '', flup_module), 'WSGIServer') 128 except: 129 print "Can't import flup." + flup_module 130 return False 122 131 123 132 # Prep up and go
