diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index b63b57a..e091c82 100644
a
|
b
|
|
1 | 1 | from optparse import make_option |
2 | 2 | import os |
3 | | import re |
4 | 3 | import sys |
5 | 4 | import socket |
6 | 5 | |
… |
… |
from django.core.handlers.wsgi import WSGIHandler
|
9 | 8 | from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException |
10 | 9 | from django.utils import autoreload |
11 | 10 | |
12 | | naiveip_re = r'^(?:(?P<addr>\d{1,3}(?:\.\d{1,3}){3}|\[[a-fA-F0-9:]+\]):)?(?P<port>\d+)$' |
13 | 11 | DEFAULT_PORT = "8000" |
14 | 12 | |
15 | 13 | class BaseRunserverCommand(BaseCommand): |
… |
… |
class BaseRunserverCommand(BaseCommand):
|
41 | 39 | self.addr = '' |
42 | 40 | self.port = DEFAULT_PORT |
43 | 41 | else: |
44 | | m = re.match(naiveip_re, addrport) |
45 | | if m is None: |
46 | | raise CommandError('%r is not a valid port number' |
47 | | 'or address:port pair.' % addrport) |
48 | | self.addr, self.port = m.groups() |
| 42 | try: |
| 43 | self.addr, self.port = addrport.rsplit(':', 1) |
| 44 | except ValueError: |
| 45 | self.addr, self.port = '', addrport |
49 | 46 | if not self.port.isdigit(): |
50 | 47 | raise CommandError("%r is not a valid port number." % self.port) |
51 | 48 | if self.addr: |