Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Documented options accepted by the runfcgi management command.

Also, modified our custom management command option docs xref parser
to also process those without a ``--`` prefix. --  Refs #14398.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4239bb0f35d40f820e344a55338f8bbe5ae9eb98 1 parent 0b39bf0
Ramiro Morales authored
14  docs/_ext/djangodocs.py
@@ -2,6 +2,7 @@
2 2
 Sphinx plugins for Django documentation.
3 3
 """
4 4
 import os
  5
+import re
5 6
 
6 7
 from docutils import nodes, transforms
7 8
 try:
@@ -21,6 +22,9 @@
21 22
 from sphinx.util.console import bold
22 23
 from sphinx.util.compat import Directive
23 24
 
  25
+# RE for option descriptions without a '--' prefix
  26
+simple_option_desc_re = re.compile(
  27
+    r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
24 28
 
25 29
 def setup(app):
26 30
     app.add_crossref_type(
@@ -207,6 +211,16 @@ def parse_django_adminopt_node(env, sig, signode):
207 211
         if not count:
208 212
             firstname = optname
209 213
         count += 1
  214
+    if not count:
  215
+        for m in simple_option_desc_re.finditer(sig):
  216
+            optname, args = m.groups()
  217
+            if count:
  218
+                signode += addnodes.desc_addname(', ', ', ')
  219
+            signode += addnodes.desc_name(optname, optname)
  220
+            signode += addnodes.desc_addname(args, args)
  221
+            if not count:
  222
+                firstname = optname
  223
+            count += 1
210 224
     if not firstname:
211 225
         raise ValueError
212 226
     return firstname
20  docs/howto/deployment/fastcgi.txt
@@ -79,19 +79,19 @@ your :doc:`manage.py </ref/django-admin>` is), and then run the
79 79
 If you specify ``help`` as the only option after :djadmin:`runfcgi`, it'll
80 80
 display a list of all the available options.
81 81
 
82  
-You'll need to specify either a ``socket``, a ``protocol`` or both ``host`` and
83  
-``port``. Then, when you set up your Web server, you'll just need to point it at
84  
-the host/port or socket you specified when starting the FastCGI server. See the
85  
-examples_, below.
  82
+You'll need to specify either a :djadminopt:`socket`, a :djadminopt:`protocol`
  83
+or both :djadminopt:`host` and :djadminopt:`port`. Then, when you set up your
  84
+Web server, you'll just need to point it at the host/port or socket you
  85
+specified when starting the FastCGI server. See the examples_, below.
86 86
 
87 87
 Protocols
88 88
 ---------
89 89
 
90 90
 Django supports all the protocols that flup_ does, namely fastcgi_, `SCGI`_ and
91 91
 `AJP1.3`_ (the Apache JServ Protocol, version 1.3). Select your preferred
92  
-protocol by using the ``protocol=<protocol_name>`` option with ``./manage.py
93  
-runfcgi`` -- where ``<protocol_name>`` may be one of: ``fcgi`` (the default),
94  
-``scgi`` or ``ajp``. For example::
  92
+protocol by using the :djadminopt:`protocol=\<protocol_name\> <protocol>` option
  93
+with ``./manage.py runfcgi`` -- where ``<protocol_name>`` may be one of:
  94
+``fcgi`` (the default), ``scgi`` or ``ajp``. For example::
95 95
 
96 96
     ./manage.py runfcgi protocol=scgi
97 97
 
@@ -131,8 +131,8 @@ Simply hitting ``Ctrl-C`` will stop and quit the FastCGI server. However, when
131 131
 you're dealing with background processes, you'll need to resort to the Unix
132 132
 ``kill`` command.
133 133
 
134  
-If you specify the ``pidfile`` option to :djadmin:`runfcgi`, you can kill the
135  
-running FastCGI daemon like this::
  134
+If you specify the :djadminopt:`pidfile` option to :djadmin:`runfcgi`, you can
  135
+kill the running FastCGI daemon like this::
136 136
 
137 137
     kill `cat $PIDFILE`
138 138
 
@@ -389,7 +389,7 @@ prefix automatically.
389 389
 
390 390
 In the cases where Django cannot work out the prefix correctly and where you
391 391
 want the original value to be used in URLs, you can set the
392  
-``FORCE_SCRIPT_NAME`` setting in your main ``settings`` file. This sets the
  392
+:setting:`FORCE_SCRIPT_NAME` setting in your main ``settings`` file. This sets the
393 393
 script name uniformly for every URL served via that settings file. Thus you'll
394 394
 need to use different settings files if you want different sets of URLs to
395 395
 have different script names in this case, but that is a rare situation.
109  docs/ref/django-admin.txt
@@ -508,6 +508,115 @@ supports the FastCGI protocol. See the :doc:`FastCGI deployment documentation
508 508
 
509 509
 .. _flup: http://www.saddi.com/software/flup/
510 510
 
  511
+The options accepted by this command are passed to the FastCGI library and
  512
+don't use the ``'--'`` prefix as is usual for other Django management commands.
  513
+
  514
+.. django-admin-option:: protocol
  515
+
  516
+``protocol=PROTOCOL``
  517
+
  518
+Protocol to use. *PROTOCOL* can be ``fcgi``, ``scgi``, ``ajp``, etc.
  519
+(default is ``fcgi``)
  520
+
  521
+.. django-admin-option:: host
  522
+
  523
+``host=HOSTNAME``
  524
+
  525
+Hostname to listen on.
  526
+
  527
+.. django-admin-option:: port
  528
+
  529
+``port=PORTNUM``
  530
+
  531
+Port to listen on.
  532
+
  533
+.. django-admin-option:: socket
  534
+
  535
+``socket=FILE``
  536
+
  537
+UNIX socket to listen on.
  538
+
  539
+.. django-admin-option:: method
  540
+
  541
+``method=IMPL``
  542
+
  543
+Possible values: ``prefork`` or ``threaded`` (default ``prefork``)
  544
+
  545
+.. django-admin-option:: maxrequests
  546
+
  547
+``maxrequests=NUMBER``
  548
+
  549
+Number of requests a child handles before it is killed and a new child is
  550
+forked (0 means no limit).
  551
+
  552
+.. django-admin-option:: maxspare
  553
+
  554
+``maxspare=NUMBER``
  555
+
  556
+Max number of spare processes / threads.
  557
+
  558
+.. django-admin-option:: minspare
  559
+
  560
+``minspare=NUMBER``
  561
+
  562
+Min number of spare processes / threads.
  563
+
  564
+.. django-admin-option:: maxchildren
  565
+
  566
+``maxchildren=NUMBER``
  567
+
  568
+Hard limit number of processes / threads.
  569
+
  570
+.. django-admin-option:: daemonize
  571
+
  572
+``daemonize=BOOL``
  573
+
  574
+Whether to detach from terminal.
  575
+
  576
+.. django-admin-option:: pidfile
  577
+
  578
+``pidfile=FILE``
  579
+
  580
+Write the spawned process-id to file *FILE*.
  581
+
  582
+.. django-admin-option:: workdir
  583
+
  584
+``workdir=DIRECTORY``
  585
+
  586
+Change to directory *DIRECTORY* when daemonizing.
  587
+
  588
+.. django-admin-option:: debug
  589
+
  590
+``debug=BOOL``
  591
+
  592
+Set to true to enable flup tracebacks.
  593
+
  594
+.. django-admin-option:: outlog
  595
+
  596
+``outlog=FILE``
  597
+
  598
+Write stdout to the *FILE* file.
  599
+
  600
+.. django-admin-option:: errlog
  601
+
  602
+``errlog=FILE``
  603
+
  604
+Write stderr to the *FILE* file.
  605
+
  606
+.. django-admin-option:: umask
  607
+
  608
+``umask=UMASK``
  609
+
  610
+Umask to use when daemonizing. The value is interpeted as an octal number
  611
+(default value is ``022``).
  612
+
  613
+Example usage::
  614
+
  615
+    django-admin.py runfcgi socket=/tmp/fcgi.sock method=prefork daemonize=true \
  616
+        pidfile=/var/run/django-fcgi.pid
  617
+
  618
+Run a FastCGI server as a daemon and write the spawned PID in a file.
  619
+
511 620
 runserver [port or ipaddr:port]
512 621
 -------------------------------
513 622
 

0 notes on commit 4239bb0

Please sign in to comment.
Something went wrong with that request. Please try again.