Ticket #14398: t14398.diff

File t14398.diff, 7.9 KB (added by Ramiro Morales, 14 years ago)

Patch for the issue

  • django/core/servers/fastcgi.py

    diff -r a8a9a277716d django/core/servers/fastcgi.py
    a b  
    2727
    2828Optional Fcgi settings: (setting=value)
    2929  protocol=PROTOCOL    fcgi, scgi, ajp, ... (default fcgi)
    30   host=HOSTNAME        hostname to listen on..
     30  host=HOSTNAME        hostname to listen on.
    3131  port=PORTNUM         port to listen on.
    3232  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
    3535                       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.
    3737  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.
    3939  daemonize=BOOL       whether to detach from terminal.
    4040  pidfile=FILE         write the spawned process-id to this file.
    4141  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.
    4343  outlog=FILE          write stdout to this file.
    4444  errlog=FILE          write stderr to this file.
    4545  umask=UMASK          umask to use when daemonizing (default 022).
     
    166166    if options['errlog']:
    167167        daemon_kwargs['err_log'] = options['errlog']
    168168    if options['umask']:
    169         daemon_kwargs['umask'] = int(options['umask'])
     169        daemon_kwargs['umask'] = int(options['umask'], 0)
    170170
    171171    if daemonize:
    172172        from django.utils.daemonize import become_daemon
  • docs/_ext/djangodocs.py

    diff -r a8a9a277716d docs/_ext/djangodocs.py
    a b  
    22Sphinx plugins for Django documentation.
    33"""
    44import os
     5import re
    56
    67from docutils import nodes, transforms
    78try:
     
    2122from sphinx.util.console import bold
    2223from sphinx.util.compat import Directive
    2324
     25# RE for option descriptions without a '--' prefix
     26simple_option_desc_re = re.compile(
     27    r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
    2428
    2529def setup(app):
    2630    app.add_crossref_type(
     
    207211        if not count:
    208212            firstname = optname
    209213        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
    210224    if not firstname:
    211225        raise ValueError
    212226    return firstname
  • docs/howto/deployment/fastcgi.txt

    diff -r a8a9a277716d docs/howto/deployment/fastcgi.txt
    a b  
    7979If you specify ``help`` as the only option after :djadmin:`runfcgi`, it'll
    8080display a list of all the available options.
    8181
    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.
     82You'll need to specify either a :djadminopt:`socket`, a :djadminopt:`protocol`
     83or both :djadminopt:`host` and :djadminopt:`port`. Then, when you set up your
     84Web server, you'll just need to point it at the host/port or socket you
     85specified when starting the FastCGI server. See the examples_, below.
    8686
    8787Protocols
    8888---------
    8989
    9090Django supports all the protocols that flup_ does, namely fastcgi_, `SCGI`_ and
    9191`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::
     92protocol by using the :djadminopt:`protocol=\<protocol_name\> <protocol>` option
     93with ``./manage.py runfcgi`` -- where ``<protocol_name>`` may be one of:
     94``fcgi`` (the default), ``scgi`` or ``ajp``. For example::
    9595
    9696    ./manage.py runfcgi protocol=scgi
    9797
     
    123123you're dealing with background processes, you'll need to resort to the Unix
    124124``kill`` command.
    125125
    126 If you specify the ``pidfile`` option to :djadmin:`runfcgi`, you can kill the
    127 running FastCGI daemon like this::
     126If you specify the :djadminopt:`pidfile` option to :djadmin:`runfcgi`, you can
     127kill the running FastCGI daemon like this::
    128128
    129129    kill `cat $PIDFILE`
    130130
     
    381381
    382382In the cases where Django cannot work out the prefix correctly and where you
    383383want the original value to be used in URLs, you can set the
    384 ``FORCE_SCRIPT_NAME`` setting in your main ``settings`` file. This sets the
     384:setting:`FORCE_SCRIPT_NAME` setting in your main ``settings`` file. This sets the
    385385script name uniformly for every URL served via that settings file. Thus you'll
    386386need to use different settings files if you want different sets of URLs to
    387387have 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  
    538538
    539539.. _flup: http://www.saddi.com/software/flup/
    540540
     541The options accepted by this command are passed to the FastCGI library and
     542don't use the ``'--'`` prefix as is usual for other Django management commands.
     543
     544.. django-admin-option:: protocol
     545
     546``protocol=PROTOCOL``
     547
     548Protocol to use. *PROTOCOL* can be ``fcgi``, ``scgi``, ``ajp``, etc.
     549(default is ``fcgi``)
     550
     551.. django-admin-option:: host
     552
     553``host=HOSTNAME``
     554
     555Hostname to listen on.
     556
     557.. django-admin-option:: port
     558
     559``port=PORTNUM``
     560
     561Port to listen on.
     562
     563.. django-admin-option:: socket
     564
     565``socket=FILE``
     566
     567UNIX socket to listen on.
     568
     569.. django-admin-option:: method
     570
     571``method=IMPL``
     572
     573Possible values: ``prefork`` or ``threaded`` (default ``prefork``)
     574
     575.. django-admin-option:: maxrequests
     576
     577``maxrequests=NUMBER``
     578
     579Number of requests a child handles before it is killed and a new child is
     580forked (0 means no limit).
     581
     582.. django-admin-option:: maxspare
     583
     584``maxspare=NUMBER``
     585
     586Max number of spare processes / threads.
     587
     588.. django-admin-option:: minspare
     589
     590``minspare=NUMBER``
     591
     592Min number of spare processes / threads.
     593
     594.. django-admin-option:: maxchildren
     595
     596``maxchildren=NUMBER``
     597
     598Hard limit number of processes / threads.
     599
     600.. django-admin-option:: daemonize
     601
     602``daemonize=BOOL``
     603
     604Whether to detach from terminal.
     605
     606.. django-admin-option:: pidfile
     607
     608``pidfile=FILE``
     609
     610Write the spawned process-id to file *FILE*.
     611
     612.. django-admin-option:: workdir
     613
     614``workdir=DIRECTORY``
     615
     616Change to directory *DIRECTORY* when daemonizing.
     617
     618.. django-admin-option:: debug
     619
     620``debug=BOOL``
     621
     622Set to true to enable flup tracebacks.
     623
     624.. django-admin-option:: outlog
     625
     626``outlog=FILE``
     627
     628Write stdout to the *FILE* file.
     629
     630.. django-admin-option:: errlog
     631
     632``errlog=FILE``
     633
     634Write stderr to the *FILE* file.
     635
     636.. django-admin-option:: umask
     637
     638``umask=UMASK``
     639
     640Umask to use when daemonizing. Both plain decimal or 0-prefixed octal
     641notations are accepted (default value is ``022``).
     642
     643Example usage::
     644
     645    django-admin.py runfcgi socket=/tmp/fcgi.sock method=prefork daemonize=true \
     646        pidfile=/var/run/django-fcgi.pid
     647
     648Run a FastCGI server as a daemon and write the spawned PID in a file.
     649
    541650runserver [port or ipaddr:port]
    542651-------------------------------
    543652
Back to Top