Ticket #360: django-server-addr.diff
File django-server-addr.diff, 2.5 KB (added by , 19 years ago) |
---|
-
django/bin/django-admin.py
87 87 ACTION_MAPPING[action](name, os.getcwd()) 88 88 elif action == 'runserver': 89 89 if len(args) < 2: 90 addr = '' 90 91 port = '8000' 91 92 else: 92 port = args[1] 93 ACTION_MAPPING[action](port) 93 if args[1].find(':') != -1: 94 addr, port = args[1].split(':') 95 else: 96 addr = '' 97 port = args[1] 98 ACTION_MAPPING[action](addr, port) 94 99 else: 95 100 from django.core import meta 96 101 if action == 'dbcheck': -
django/core/servers/basehttp.py
636 636 start_response(status, headers.items()) 637 637 return output 638 638 639 def run( port, wsgi_handler):640 server_address = ( '', port)639 def run(addr, port, wsgi_handler): 640 server_address = (addr, port) 641 641 httpd = WSGIServer(server_address, WSGIRequestHandler) 642 642 httpd.set_app(wsgi_handler) 643 643 httpd.serve_forever() -
django/core/management.py
543 543 print '%s error%s found.' % (num_errors, num_errors != 1 and 's' or '') 544 544 validate.args = '' 545 545 546 def runserver( port):546 def runserver(addr, port): 547 547 "Starts a lightweight Web server for development." 548 548 from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException 549 549 from django.core.handlers.wsgi import WSGIHandler … … 555 555 print "Validating models..." 556 556 validate() 557 557 print "\nStarting server on port %s with settings module %r." % (port, SETTINGS_MODULE) 558 print "Go to http:// 127.0.0.1:%s/ for Django." % port558 print "Go to http://%s:%s/ for Django." % (addr, port) 559 559 print "Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows)." 560 560 try: 561 run( int(port), AdminMediaHandler(WSGIHandler()))561 run(addr, int(port), AdminMediaHandler(WSGIHandler())) 562 562 except WSGIServerException, e: 563 563 # Use helpful error messages instead of ugly tracebacks. 564 564 ERRORS = {