diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index 206d66f..a882ec4 100644
|
a
|
b
|
FILE_CHARSET = 'utf-8'
|
| 181 | 181 | # Email address that error messages come from. |
| 182 | 182 | SERVER_EMAIL = 'root@localhost' |
| 183 | 183 | |
| | 184 | # The default IP and port for local development server to use. |
| | 185 | RUNSERVER_IP = '' |
| | 186 | RUNSERVER_PORT = '' |
| | 187 | |
| 184 | 188 | # Database connection info. If left empty, will default to the dummy backend. |
| 185 | 189 | DATABASES = {} |
| 186 | 190 | |
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
|
| 27 | 27 | |
| 28 | 28 | ALLOWED_HOSTS = [] |
| 29 | 29 | |
| | 30 | RUNSERVER_IP = '127.0.0.1' |
| | 31 | |
| | 32 | RUNSERVER_PORT = '8000' |
| 30 | 33 | |
| 31 | 34 | # Application definition |
| 32 | 35 | |
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):
|
| 29 | 29 | requires_system_checks = False |
| 30 | 30 | leave_locale_alone = True |
| 31 | 31 | |
| 32 | | default_port = '8000' |
| | 32 | default_port = settings.RUNSERVER_PORT |
| 33 | 33 | |
| 34 | 34 | def add_arguments(self, parser): |
| 35 | 35 | parser.add_argument( |
| … |
… |
class Command(BaseCommand):
|
| 75 | 75 | self._raw_ipv6 = False |
| 76 | 76 | if not options['addrport']: |
| 77 | 77 | self.addr = '' |
| 78 | | self.port = self.default_port |
| | 78 | self.port = settings.RUNSERVER_PORT |
| 79 | 79 | else: |
| 80 | 80 | m = re.match(naiveip_re, options['addrport']) |
| 81 | 81 | if m is None: |
| … |
… |
class Command(BaseCommand):
|
| 92 | 92 | elif self.use_ipv6 and not _fqdn: |
| 93 | 93 | raise CommandError('"%s" is not a valid IPv6 address.' % self.addr) |
| 94 | 94 | 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 |
| 96 | 96 | self._raw_ipv6 = self.use_ipv6 |
| 97 | 97 | self.run(**options) |
| 98 | 98 | |