Ticket #27537: 27537.diff

File 27537.diff, 2.1 KB (added by Kamalavelan, 8 years ago)
  • django/conf/global_settings.py

    diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
    index 206d66f..a882ec4 100644
    a b FILE_CHARSET = 'utf-8'  
    181181# Email address that error messages come from.
    182182SERVER_EMAIL = 'root@localhost'
    183183
     184# The default IP and port for local development server to use.
     185RUNSERVER_IP = ''
     186RUNSERVER_PORT = ''
     187
    184188# Database connection info. If left empty, will default to the dummy backend.
    185189DATABASES = {}
    186190
  • django/conf/project_template/project_name/settings.py-tpl

    diff --git a/django/conf/project_template/project_name/settings.py-tpl b/django/conf/project_template/project_name/settings.py-tpl
    index 7dfe186..3b1da4c 100644
    a b DEBUG = True  
    2727
    2828ALLOWED_HOSTS = []
    2929
     30RUNSERVER_IP = '127.0.0.1'
     31
     32RUNSERVER_PORT = '8000'
    3033
    3134# Application definition
    3235
  • django/core/management/commands/runserver.py

    diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
    index b757783..fd306fb 100644
    a b class Command(BaseCommand):  
    2929    requires_system_checks = False
    3030    leave_locale_alone = True
    3131
    32     default_port = '8000'
     32    default_port = settings.RUNSERVER_PORT
    3333
    3434    def add_arguments(self, parser):
    3535        parser.add_argument(
    class Command(BaseCommand):  
    7575        self._raw_ipv6 = False
    7676        if not options['addrport']:
    7777            self.addr = ''
    78             self.port = self.default_port
     78            self.port = settings.RUNSERVER_PORT
    7979        else:
    8080            m = re.match(naiveip_re, options['addrport'])
    8181            if m is None:
    class Command(BaseCommand):  
    9292                elif self.use_ipv6 and not _fqdn:
    9393                    raise CommandError('"%s" is not a valid IPv6 address.' % self.addr)
    9494        if not self.addr:
    95             self.addr = '::1' if self.use_ipv6 else '127.0.0.1'
     95            self.addr = '::1' if self.use_ipv6 else settings.RUNSERVER_IP
    9696            self._raw_ipv6 = self.use_ipv6
    9797        self.run(**options)
    9898
Back to Top