Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#14928 closed (fixed)

manage runserver does not allow host name as address

Reported by: Karmel Allison Owned by: Łukasz Rekucki
Component: django-admin.py runserver Version: 1.3-alpha
Severity: Keywords: blocker
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In Django 1.2, it was possible to use a host name (i.e., example.com) to run a Django server from manage.py:

python manage.py runserver example.com:8000

However, that convenience has been removed in Django 1.3-alpha. It looks like in order to add functionality for IPv6 addresses, a regex was added (r14711, line 12) that raises an error if non-IP-like addresses are used:

python manage.py runserver example.com:8000
Error: 'example.com:8000' is not a valid port numberor address:port pair.

The ability to run the server using host names was quite convenient, and preferable in many cases to having an IP specified. Would it be possible to re-enable that feature?

Thanks!

Attachments (3)

14928-1.diff (1.4 KB ) - added by Claude Paroz 13 years ago.
Allow FQDN in addr part of runserver
14928.diff (4.3 KB ) - added by Łukasz Rekucki 13 years ago.
Alternative patch, that accepts ASCII hostnames.
14928-2.diff (6.4 KB ) - added by Claude Paroz 13 years ago.
Patch of lregucki with basic tests

Download all attachments as: .zip

Change History (13)

comment:1 by rasca, 13 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

I can confirm the behavior. Accepting the ticket.

This should be fixed before releasing 1.3.

comment:2 by Łukasz Rekucki, 13 years ago

Owner: changed from nobody to Łukasz Rekucki

comment:3 by Jannis Leidel, 13 years ago

Triage Stage: AcceptedDesign decision needed

Not really a regression since it was not only undocumented but also clearly defined as a IP:port pair

comment:4 by Russell Keith-Magee, 13 years ago

Keywords: blocker added

comment:5 by Claude Paroz, 13 years ago

I've also a use case where I need to provide a FQDN to runserver (handling of various subdomains in an app). I do not see the real advantage of using the regex instead of the simpler (r)split that was previously used. The addr part of the 'addr:port' sequence is my business, not Django's.

by Claude Paroz, 13 years ago

Attachment: 14928-1.diff added

Allow FQDN in addr part of runserver

comment:6 by Claude Paroz, 13 years ago

Has patch: set

comment:7 by Łukasz Rekucki, 13 years ago

I used a regex, because I needed a simple way to distinguish between IPv4 and IPv6. I think splitting on ":" is confusing as it's also an IPv6 address separator. I also wanted to give the user more meaningful error messages.

by Łukasz Rekucki, 13 years ago

Attachment: 14928.diff added

Alternative patch, that accepts ASCII hostnames.

comment:8 by Jannis Leidel, 13 years ago

Triage Stage: Design decision neededReady for checkin

Yah, lrekuck's patch seems to work nicely.

by Claude Paroz, 13 years ago

Attachment: 14928-2.diff added

Patch of lregucki with basic tests

comment:9 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

(In [15215]) Fixed #14928 -- Ensure that a fully qualified domain name can be used for runserver. Thanks to Karmel Allison for the report, Łukasz Rekucki for the patch, and claudep for the tests.

comment:10 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top