Code

Ticket #6163: 6163-2.diff

File 6163-2.diff, 2.9 KB (added by claudep, 2 years ago)

Patch updated to current trunk (method option untouched)

Line 
1diff --git a/django/core/servers/fastcgi.py b/django/core/servers/fastcgi.py
2index cacac3d..f20a338 100644
3--- a/django/core/servers/fastcgi.py
4+++ b/django/core/servers/fastcgi.py
5@@ -19,6 +19,25 @@ from django.utils import importlib
6 __version__ = "0.1"
7 __all__ = ["runfastcgi"]
8 
9+FASTCGI_OPTIONS = {
10+    'protocol': 'fcgi',
11+    'host': None,
12+    'port': None,
13+    'socket': None,
14+    'method': 'fork',
15+    'daemonize': None,
16+    'workdir': '/',
17+    'pidfile': None,
18+    'maxspare': 5,
19+    'minspare': 2,
20+    'maxchildren': 50,
21+    'maxrequests': 0,
22+    'debug': None,
23+    'outlog': None,
24+    'errlog': None,
25+    'umask': None,
26+}
27+
28 FASTCGI_HELP = r"""
29   Run this project as a fastcgi (or some other protocol supported
30   by flup) application. To do this, the flup package from
31@@ -27,19 +46,19 @@ FASTCGI_HELP = r"""
32    runfcgi [options] [fcgi settings]
33 
34 Optional Fcgi settings: (setting=value)
35-  protocol=PROTOCOL    fcgi, scgi, ajp, ... (default fcgi)
36+  protocol=PROTOCOL    fcgi, scgi, ajp, ... (default %(protocol)s)
37   host=HOSTNAME        hostname to listen on.
38   port=PORTNUM         port to listen on.
39   socket=FILE          UNIX socket to listen on.
40-  method=IMPL          prefork or threaded (default prefork).
41+  method=IMPL          prefork or threaded (default %(method)s).
42   maxrequests=NUMBER   number of requests a child handles before it is
43                        killed and a new child is forked (0 = no limit).
44-  maxspare=NUMBER      max number of spare processes / threads.
45-  minspare=NUMBER      min number of spare processes / threads.
46-  maxchildren=NUMBER   hard limit number of processes / threads.
47+  maxspare=NUMBER      max number of spare processes / threads (default %(maxspare)s).
48+  minspare=NUMBER      min number of spare processes / threads (default %(minspare)s).
49+  maxchildren=NUMBER   hard limit number of processes / threads (default %(maxchildren)s).
50   daemonize=BOOL       whether to detach from terminal.
51   pidfile=FILE         write the spawned process-id to this file.
52-  workdir=DIRECTORY    change to this directory when daemonizing.
53+  workdir=DIRECTORY    change to this directory when daemonizing (default %(workdir)s).
54   debug=BOOL           set to true to enable flup tracebacks.
55   outlog=FILE          write stdout to this file.
56   errlog=FILE          write stderr to this file.
57@@ -60,26 +79,7 @@ Examples:
58     $ manage.py runfcgi socket=/tmp/fcgi.sock method=prefork \
59         daemonize=true pidfile=/var/run/django-fcgi.pid
60 
61-"""
62-
63-FASTCGI_OPTIONS = {
64-    'protocol': 'fcgi',
65-    'host': None,
66-    'port': None,
67-    'socket': None,
68-    'method': 'fork',
69-    'daemonize': None,
70-    'workdir': '/',
71-    'pidfile': None,
72-    'maxspare': 5,
73-    'minspare': 2,
74-    'maxchildren': 50,
75-    'maxrequests': 0,
76-    'debug': None,
77-    'outlog': None,
78-    'errlog': None,
79-    'umask': None,
80-}
81+""" % FASTCGI_OPTIONS
82 
83 def fastcgi_help(message=None):
84     print FASTCGI_HELP