Opened 14 years ago

Closed 12 years ago

#14332 closed New feature (wontfix)

manage testserver and manage runserver should have similiar address:port options

Reported by: wildfire@… Owned by: Fede Heinz
Component: Core (Management commands) Version: 1.2
Severity: Normal Keywords: runserver, testserver
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Hi,

$ ./manage.py runserver -h
Usage: ./manage.py runserver [options] [optional port number, or ipaddr:port]

Starts a lightweight Web server for development.

[...]

$ ./manage.py testserver -h
Usage: ./manage.py testserver [options] [fixture ...]

In order to get the testserver to listen on a particular port, you need to specify the --addrport option.

It would be useful if that option was also understood by the normal runserver command. Or if testserver interpreted a bare port number as the runserver command does.

Attachments (1)

uniform_addrport_handling.patch (6.7 KB ) - added by Fede Heinz 14 years ago.
This patch implements the requested feature

Download all attachments as: .zip

Change History (13)

comment:1 by Gabriel Hurley, 14 years ago

Component: Uncategorizeddjango-admin.py

comment:2 by Fede Heinz, 14 years ago

Owner: changed from nobody to Fede Heinz

by Fede Heinz, 14 years ago

This patch implements the requested feature

comment:3 by Fede Heinz, 14 years ago

Has patch: set
Status: newassigned
Triage Stage: UnreviewedAccepted

The attached patch implements and documents the requested feature. For backwards compatibility, both runserver and testserver now accept both ways of specifying the IP address.

comment:4 by Fede Heinz, 14 years ago

Resolution: fixed
Status: assignedclosed

14332

comment:5 by Ramiro Morales, 14 years ago

Resolution: fixed
Status: closedreopened

Reopening. The fixed status is set when a commit lands in the code repository.

comment:6 by Łukasz Rekucki, 14 years ago

Patch needs improvement: set
Triage Stage: AcceptedDesign decision needed

I'm against doing it this way. I see no value for having --addrport option for runserver. Duplicating functionality is a bad thing, imho (You know, "there should be one obvious way to do it", etc.). A minor backwards compatibility issue is that someone can have a fixture named "1000", which will now get interpreted as port number.

If I was to propose something, it would be deprectating --addrport and runserver's positional syntax in favour of --host and --port options. That would at least be consistent with most UNIX tools, but I'm generally -0 on changing anything here.

comment:7 by Fede Heinz, 14 years ago

I agree that "there should be one obvious way to do it" is a Good Thing. What we have now is "there are two incompatible ways to do it, and you must choose the right one or it won't work".

The change you propose would give us indeed one way to do it, at the price of breaking backwards compatibility for *both* runserver and testserver.

I know that the current implementation doesn't work if you absolutely need to give a fixture a numerical name without extension, and put it first in the list of fixtures. That is an unlikely use case, and the --addrport option saves the day anyway.

The way I see it, of the three option that are on the table right now (providing a homogeneous interface that breaks backwards compatibility, providing a homogeneous but redundant user interface without breaking backwards compatibility, and leaving things as they are with an redundant and inconsistent interface), the patch implements the least objectionable one.

comment:8 by Graham King, 14 years ago

Keywords: runserver testserver added
Severity: Normal
Type: New feature

comment:9 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:10 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:11 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:12 by Aymeric Augustin, 12 years ago

Resolution: wontfix
Status: newclosed

runserver is about 10000x more used that testserver.

I'm -1 on making changes to runserver (especially changes towards a longer syntax) only to provide consistency with an obscure command few developers use.

I'm not very excited either by special casing the first argument to testserver to magically determine if it's a binding spec or a fixture name, such hacks backfire too often.

Please take it to django-developers to see if there's actual demand for changes, the current situation doesn't seem horrific to me. testserver needs arguments, runserver doesn't, that's it.

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