Ticket #8628: add_devserver_settings.patch

File add_devserver_settings.patch, 5.7 KB (added by k0001, 7 years ago)
  • django/conf/global_settings.py

     
    5252    ('el', gettext_noop('Greek')),
    5353    ('en', gettext_noop('English')),
    5454    ('es', gettext_noop('Spanish')),
    55     ('et', gettext_noop('Estonian')), 
     55    ('et', gettext_noop('Estonian')),
    5656    ('es-ar', gettext_noop('Argentinean Spanish')),
    5757    ('eu', gettext_noop('Basque')),
    5858    ('fa', gettext_noop('Persian')),
     
    393393TEST_DATABASE_CHARSET = None
    394394TEST_DATABASE_COLLATION = None
    395395
     396######################
     397# DEVELOPMENT SERVER #
     398# ####################
     399
     400# Default address and port where to bind the development server
     401DEVELOPMENT_SERVER_ADDRESS = '127.0.0.1'
     402DEVELOPMENT_SERVER_PORT = '8000'
     403
    396404############
    397405# FIXTURES #
    398406############
  • django/core/management/commands/runserver.py

     
    2020        import django
    2121        from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException
    2222        from django.core.handlers.wsgi import WSGIHandler
     23        from django.conf import settings
     24
    2325        if args:
    2426            raise CommandError('Usage is runserver %s' % self.args)
    2527        if not addrport:
    2628            addr = ''
    27             port = '8000'
     29            port = str(settings.DEVELOPMENT_SERVER_PORT)
    2830        else:
    2931            try:
    3032                addr, port = addrport.split(':')
    3133            except ValueError:
    3234                addr, port = '', addrport
    3335        if not addr:
    34             addr = '127.0.0.1'
     36            addr = settings.DEVELOPMENT_SERVER_ADDRESS
    3537
    3638        if not port.isdigit():
    3739            raise CommandError("%r is not a valid port number." % port)
  • docs/ref/django-admin.txt

     
    9595Available subcommands
    9696=====================
    9797
    98 cleanup 
     98cleanup
    9999-------
    100100
    101101**New in Django development version**
     
    121121
    122122    django-admin.py compilemessages --locale=br_PT
    123123
    124 createcachetable 
     124createcachetable
    125125----------------
    126126
    127127.. django-admin:: createcachetable <tablename>
     
    132132createsuperuser
    133133---------------
    134134
    135 .. django-admin:: createsuperuser 
     135.. django-admin:: createsuperuser
    136136
    137137**New in Django development version**
    138138
     
    181181.. django-admin:: diffsettings
    182182
    183183Displays differences between the current settings file and Django's default
    184 settings. 
     184settings.
    185185
    186186Settings that don't appear in the defaults are followed by ``"###"``. For
    187187example, the default settings don't define ``ROOT_URLCONF``, so
     
    431431Use the ``--domain`` or ``-d`` option to change the domain of the messages files.
    432432Currently supported:
    433433
    434         * ``django`` for all ``*.py`` and ``*.html`` files (default) 
     434        * ``django`` for all ``*.py`` and ``*.html`` files (default)
    435435        * ``djangojs`` for ``*.js`` files
    436436
    437437--verbosity
     
    546546
    547547    django-admin.py runserver 1.2.3.4:7000
    548548
     549You could also set the default address and port values by changing
     550:setting:`DEVELOPMENT_SERVER_ADDRESS` and :setting:`DEVELOPMENT_SERVER_PORT` in
     551your settings respectively.
     552
    549553Serving static files with the development server
    550554~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    551555
     
    879883
    880884
    881885
    882 See :ref:`howto-custom-management-commands` for how to add customized actions. 
     886See :ref:`howto-custom-management-commands` for how to add customized actions.
  • docs/ref/settings.txt

     
    224224default port. Not used with SQLite.
    225225
    226226.. setting:: DATABASE_USER
    227    
     227
    228228DATABASE_USER
    229229-------------
    230230
     
    247247and ``MONTH_DAY_FORMAT``.
    248248
    249249.. setting:: DATETIME_FORMAT
    250    
     250
    251251DATETIME_FORMAT
    252252---------------
    253253
     
    361361Default tablespace to use for indexes on fields that don't specify
    362362one, if the backend supports it.
    363363
     364.. setting:: DEVELOPMENT_SERVER_ADDRESS
     365
     366DEVELOPMENT_SERVER_ADDRESS
     367--------------------------
     368
     369**New in Django development version**
     370
     371Default: ``'127.0.0.1'``
     372
     373Address where to bind the built in development server by default.
     374
     375.. setting:: DEVELOPMENT_SERVER_PORT
     376
     377DEVELOPMENT_SERVER_PORT
     378-----------------------
     379
     380**New in Django development version**
     381
     382Default: ``'8000'``
     383
     384Port where to bind the built in development server by default.
     385
    364386.. setting:: DISALLOWED_USER_AGENTS
    365387
    366388DISALLOWED_USER_AGENTS
     
    513535.. warning::
    514536
    515537    **Always prefix the mode with a 0.**
    516    
     538
    517539    If you're not familiar with file modes, please note that the leading
    518540    ``0`` is very important: it indicates an octal number, which is the
    519541    way that modes must be specified. If you try to use ``644``, you'll
    520542    get totally incorrect behavior.
    521    
    522543
    523 .. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
    524544
     545.. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
     546
    525547.. setting:: FIXTURE_DIRS
    526548
    527549FIXTURE_DIRS
     
    11571179    Django cannot reliably use alternate time zones in a Windows environment.
    11581180    If you're running Django on Windows, this variable must be set to match the
    11591181    system timezone.
    1160    
     1182
    11611183.. _See available choices: http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
    11621184
    11631185.. setting:: URL_VALIDATOR_USER_AGENT
Back to Top