Ticket #2461: iputils.diff
File iputils.diff, 2.0 KB (added by , 18 years ago) |
---|
-
django/core/management.py
5 5 from django.core.exceptions import ImproperlyConfigured 6 6 import os, re, shutil, sys, textwrap 7 7 from optparse import OptionParser 8 from django.utils import termcolors 8 from django.utils import termcolors, iputils 9 9 10 10 # For Python 2.3 11 11 if not hasattr(__builtins__, 'set'): … … 1027 1027 "Starts a lightweight Web server for development." 1028 1028 from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException 1029 1029 from django.core.handlers.wsgi import WSGIHandler 1030 if not addr:1031 addr = '127.0.0.1'1032 if not port.isdigit():1033 sys.stderr.write(style.ERROR("Error: %r is not a valid port number.\n" % port))1034 sys.exit(1)1030 ## if not addr: 1031 ## addr = '127.0.0.1' 1032 ## if not port.isdigit(): 1033 ## sys.stderr.write(style.ERROR("Error: %r is not a valid port number.\n" % port)) 1034 ## sys.exit(1) 1035 1035 quit_command = sys.platform == 'win32' and 'CTRL-BREAK' or 'CONTROL-C' 1036 1036 def inner_run(): 1037 1037 from django.conf import settings … … 1261 1261 action_mapping[action](name, os.getcwd()) 1262 1262 elif action == 'runserver': 1263 1263 if len(args) < 2: 1264 addr = '' 1265 port = '8000' 1264 addr, port = iputils.make_ipv4_host_port() 1265 ## addr = '' 1266 ## port = '8000' 1266 1267 else: 1267 try: 1268 addr, port = args[1].split(':') 1269 except ValueError: 1270 addr, port = '', args[1] 1268 addr, port = iputils.make_ipv4_host_port(args[1]) 1269 ## try: 1270 ## addr, port = args[1].split(':') 1271 ## except ValueError: 1272 ## addr, port = '', args[1] 1271 1273 action_mapping[action](addr, port, options.use_reloader) 1272 1274 elif action == 'runfcgi': 1273 1275 action_mapping[action](args[1:])