Ticket #2105: service-names.diff

File service-names.diff, 792 bytes (added by mail@…, 18 years ago)
  • django/core/management.py

     
    980980    if not addr:
    981981        addr = '127.0.0.1'
    982982    if not port.isdigit():
    983         sys.stderr.write(style.ERROR("Error: %r is not a valid port number.\n" % port))
    984         sys.exit(1)
     983        import socket
     984        try:
     985            port = socket.getservbyname(port, 'tcp')
     986        except socket.error:
     987            sys.stderr.write(style.ERROR("Error: %r is not a valid port number or service name.\n" % port))
     988            sys.exit(1)
    985989    quit_command = sys.platform == 'win32' and 'CTRL-BREAK' or 'CONTROL-C'
    986990    def inner_run():
    987991        from django.conf import settings
Back to Top