IPv6 support for runserver
The runserver management command does not support IPv6 addresses. The attached patch does the following things (all relatively minor) to add that support:
- Adds an --ipv6, -6 option (default disabled) to runserver's options list.
- Adds a test for socket.AF_INET6. If it's missing, raise a command error about IPv6 support in Python.
- Change the addr:port split code from split(':') to rsplit(':',1).
- Change the default address from 127.0.0.1 to ::1 when IPv6 is being enabled.
- Signals the run routine from django.core.servers.basehttp by a named enable_ipv6 parameter.
- Change the aforementioned run routine to declare and use, only when enable_ipv6 is true, a WSGIServerV6 class to override the default address family (set to AF_INET by python's SocketServer.TCPServer class).