#7735 closed (fixed)
IPv6 support for runserver
Reported by: | jbalonso | Owned by: | jbalonso |
---|---|---|---|
Component: | django-admin.py runserver | Version: | dev |
Severity: | Keywords: | ipv6 | |
Cc: | jalonso@…, nreilly@…, eromijn@…, Łukasz Rekucki | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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).
Attachments (4)
Change History (18)
by , 16 years ago
Attachment: | runserver-ipv6-r7871.diff added |
---|
comment:1 by , 16 years ago
Needs documentation: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
milestone: | → post-1.0 |
---|
I'm definitely a huge +1 on this. Marking as post-1.0 because it isn't necessary to get 1.0 out the door. It is too small a feature to but on the official "maybe" list, but if the patch works now I see no reason to delay it past the 1.0 release.
comment:4 by , 16 years ago
Needs documentation: | unset |
---|---|
Owner: | changed from | to
Status: | new → assigned |
I'm posting an updated patch, now with improved paying-attention-to-directions (I didn't run svn diff from the root of trunk the first time around) and documentation. I did my best to blend in my documentation with existing style, but I encourage extra scrutiny on my first contribution.
by , 16 years ago
Attachment: | runserver-ipv6-with-docs-r7920.diff added |
---|
IPv6 support for runserver and docs against rev 7920
comment:5 by , 16 years ago
Cc: | added |
---|
follow-up: 9 comment:7 by , 14 years ago
Is jbalonso still tracking this ticket? It's been quiet for a year.
Also, why is this in design decision needed? It seems like a pretty normal thing to add, and the patch seems OK (although it will probably need updating to apply cleanly to trunk).
comment:8 by , 14 years ago
Cc: | added |
---|
comment:9 by , 14 years ago
Replying to erikr:
Is jbalonso still tracking this ticket? It's been quiet for a year.
Yes, I'm still here. It's been closer to two years, actually.
Also, why is this in design decision needed? It seems like a pretty normal thing to add, and the patch seems OK (although it will probably need updating to apply cleanly to trunk).
I haven't been keeping the patch up-to-date (or even checking, for that matter), because I wanted to hear a "Yes, we'll take that" rather than chasing trunk on a whim and a prayer.
That said, I'd happily brush it up again.
comment:10 by , 14 years ago
milestone: | → 1.3 |
---|---|
Patch needs improvement: | set |
Triage Stage: | Design decision needed → Accepted |
by , 14 years ago
Attachment: | runserver-ipv6-with-docs-r13350.diff added |
---|
I took the liberty to update a patch to revision 13350. One important change, is that the URL for IPv6 should be http://[address]:port/ (with brackets).
comment:11 by , 14 years ago
Awesome! You beat me to the punch by about a day--I had just pulled trunk to work on updating my patch. I like your more-compact style better.
by , 14 years ago
Attachment: | ticket7735.diff added |
---|
Updated patch: Use "[200::addr:1]:port" format for IPv6 and detect it. Enable ipv6 in testserver.
comment:12 by , 14 years ago
Cc: | added |
---|---|
Patch needs improvement: | unset |
comment:13 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
IPv6 support for runserver against rev 7871