diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index b757783..e75fd18 100644
a
|
b
|
class Command(BaseCommand):
|
82 | 82 | raise CommandError('"%s" is not a valid port number ' |
83 | 83 | 'or address:port pair.' % options['addrport']) |
84 | 84 | self.addr, _ipv4, _ipv6, _fqdn, self.port = m.groups() |
85 | | if not self.port.isdigit(): |
| 85 | if not self.port.isdigit() or not 0 <= int(self.port) <= 65535: |
86 | 86 | raise CommandError("%r is not a valid port number." % self.port) |
87 | 87 | if self.addr: |
88 | 88 | if _ipv6: |