diff options
| author | Ed Morley <edmorley@users.noreply.github.com> | 2017-01-27 18:30:27 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-27 13:30:27 -0500 |
| commit | 751d77cdd924c5380532d231f95c1bd2f34960d5 (patch) | |
| tree | 031a77adc011c43610816ef4f5d89624d6c3b0b3 /django | |
| parent | 0cbfc844a392ae3fd47cc2cf28ba872f19f1d301 (diff) | |
Refs #27537 -- Added default_addr(_ipv6) attributes to runserver command.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/runserver.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index 2523c1b5f3..cc47b14ca2 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -29,6 +29,8 @@ class Command(BaseCommand): requires_system_checks = False leave_locale_alone = True + default_addr = '127.0.0.1' + default_addr_ipv6 = '::1' default_port = '8000' protocol = 'http' server_cls = WSGIServer @@ -94,7 +96,7 @@ class Command(BaseCommand): elif self.use_ipv6 and not _fqdn: raise CommandError('"%s" is not a valid IPv6 address.' % self.addr) if not self.addr: - self.addr = '::1' if self.use_ipv6 else '127.0.0.1' + self.addr = self.default_addr_ipv6 if self.use_ipv6 else self.default_addr self._raw_ipv6 = self.use_ipv6 self.run(**options) |
