Ticket #14398: t14398.diff
File t14398.diff, 7.9 KB (added by , 14 years ago) |
---|
-
django/core/servers/fastcgi.py
diff -r a8a9a277716d django/core/servers/fastcgi.py
a b 27 27 28 28 Optional Fcgi settings: (setting=value) 29 29 protocol=PROTOCOL fcgi, scgi, ajp, ... (default fcgi) 30 host=HOSTNAME hostname to listen on. .30 host=HOSTNAME hostname to listen on. 31 31 port=PORTNUM port to listen on. 32 32 socket=FILE UNIX socket to listen on. 33 method=IMPL prefork or threaded (default prefork) 34 maxrequests=NUMBER number of requests a child handles before it is 33 method=IMPL prefork or threaded (default prefork). 34 maxrequests=NUMBER number of requests a child handles before it is 35 35 killed and a new child is forked (0 = no limit). 36 maxspare=NUMBER max number of spare processes / threads 36 maxspare=NUMBER max number of spare processes / threads. 37 37 minspare=NUMBER min number of spare processes / threads. 38 maxchildren=NUMBER hard limit number of processes / threads 38 maxchildren=NUMBER hard limit number of processes / threads. 39 39 daemonize=BOOL whether to detach from terminal. 40 40 pidfile=FILE write the spawned process-id to this file. 41 41 workdir=DIRECTORY change to this directory when daemonizing. 42 debug=BOOL set to true to enable flup tracebacks 42 debug=BOOL set to true to enable flup tracebacks. 43 43 outlog=FILE write stdout to this file. 44 44 errlog=FILE write stderr to this file. 45 45 umask=UMASK umask to use when daemonizing (default 022). … … 166 166 if options['errlog']: 167 167 daemon_kwargs['err_log'] = options['errlog'] 168 168 if options['umask']: 169 daemon_kwargs['umask'] = int(options['umask'] )169 daemon_kwargs['umask'] = int(options['umask'], 0) 170 170 171 171 if daemonize: 172 172 from django.utils.daemonize import become_daemon -
docs/_ext/djangodocs.py
diff -r a8a9a277716d docs/_ext/djangodocs.py
a b 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 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 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 -
docs/howto/deployment/fastcgi.txt
diff -r a8a9a277716d docs/howto/deployment/fastcgi.txt
a b 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`` and83 ``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.py93 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 … … 123 123 you're dealing with background processes, you'll need to resort to the Unix 124 124 ``kill`` command. 125 125 126 If you specify the ``pidfile`` option to :djadmin:`runfcgi`, you can kill the127 running FastCGI daemon like this::126 If you specify the :djadminopt:`pidfile` option to :djadmin:`runfcgi`, you can 127 kill the running FastCGI daemon like this:: 128 128 129 129 kill `cat $PIDFILE` 130 130 … … 381 381 382 382 In the cases where Django cannot work out the prefix correctly and where you 383 383 want the original value to be used in URLs, you can set the 384 ``FORCE_SCRIPT_NAME`` setting in your main ``settings`` file. This sets the384 :setting:`FORCE_SCRIPT_NAME` setting in your main ``settings`` file. This sets the 385 385 script name uniformly for every URL served via that settings file. Thus you'll 386 386 need to use different settings files if you want different sets of URLs to 387 387 have different script names in this case, but that is a rare situation. -
docs/ref/django-admin.txt
diff -r a8a9a277716d docs/ref/django-admin.txt
a b 538 538 539 539 .. _flup: http://www.saddi.com/software/flup/ 540 540 541 The options accepted by this command are passed to the FastCGI library and 542 don't use the ``'--'`` prefix as is usual for other Django management commands. 543 544 .. django-admin-option:: protocol 545 546 ``protocol=PROTOCOL`` 547 548 Protocol to use. *PROTOCOL* can be ``fcgi``, ``scgi``, ``ajp``, etc. 549 (default is ``fcgi``) 550 551 .. django-admin-option:: host 552 553 ``host=HOSTNAME`` 554 555 Hostname to listen on. 556 557 .. django-admin-option:: port 558 559 ``port=PORTNUM`` 560 561 Port to listen on. 562 563 .. django-admin-option:: socket 564 565 ``socket=FILE`` 566 567 UNIX socket to listen on. 568 569 .. django-admin-option:: method 570 571 ``method=IMPL`` 572 573 Possible values: ``prefork`` or ``threaded`` (default ``prefork``) 574 575 .. django-admin-option:: maxrequests 576 577 ``maxrequests=NUMBER`` 578 579 Number of requests a child handles before it is killed and a new child is 580 forked (0 means no limit). 581 582 .. django-admin-option:: maxspare 583 584 ``maxspare=NUMBER`` 585 586 Max number of spare processes / threads. 587 588 .. django-admin-option:: minspare 589 590 ``minspare=NUMBER`` 591 592 Min number of spare processes / threads. 593 594 .. django-admin-option:: maxchildren 595 596 ``maxchildren=NUMBER`` 597 598 Hard limit number of processes / threads. 599 600 .. django-admin-option:: daemonize 601 602 ``daemonize=BOOL`` 603 604 Whether to detach from terminal. 605 606 .. django-admin-option:: pidfile 607 608 ``pidfile=FILE`` 609 610 Write the spawned process-id to file *FILE*. 611 612 .. django-admin-option:: workdir 613 614 ``workdir=DIRECTORY`` 615 616 Change to directory *DIRECTORY* when daemonizing. 617 618 .. django-admin-option:: debug 619 620 ``debug=BOOL`` 621 622 Set to true to enable flup tracebacks. 623 624 .. django-admin-option:: outlog 625 626 ``outlog=FILE`` 627 628 Write stdout to the *FILE* file. 629 630 .. django-admin-option:: errlog 631 632 ``errlog=FILE`` 633 634 Write stderr to the *FILE* file. 635 636 .. django-admin-option:: umask 637 638 ``umask=UMASK`` 639 640 Umask to use when daemonizing. Both plain decimal or 0-prefixed octal 641 notations are accepted (default value is ``022``). 642 643 Example usage:: 644 645 django-admin.py runfcgi socket=/tmp/fcgi.sock method=prefork daemonize=true \ 646 pidfile=/var/run/django-fcgi.pid 647 648 Run a FastCGI server as a daemon and write the spawned PID in a file. 649 541 650 runserver [port or ipaddr:port] 542 651 ------------------------------- 543 652