Opened 12 years ago

Closed 12 years ago

#2105 closed enhancement (wontfix)

[patch] Allow runserver to use service names as well as port numbers

Reported by: mail@… Owned by: Adrian Holovaty
Component: Core (Management commands) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This patch allows a named service to be passed to runserver instead of a port number.

e.g. if /etc/services contains the line

dummy     12345/tcp

then you can run: runserver dummy

to start the server on port 12345.

Attachments (1)

service-names.diff (792 bytes) - added by mail@… 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by mail@…

Attachment: service-names.diff added

comment:1 Changed 12 years ago by Adrian Holovaty

Do people typically know port service names, or is this too much of a special case?

comment:2 Changed 12 years ago by Fraser Nevett <mail@…>

I agree this is probably a special case.

This came about because we have a shared development server, and thought it would be sensible to assign each developer with a port so they can each run their own instance of Django. In /etc/services we have a port for each developer's name; for example:

tom    9000/tcp
dick   9001/tcp
harry  9002/tcp

I'm not overly concerned if this gets included, but I believe the interchangeability of port numbers and service names is a pretty standard Linux/Unix feature so we might want to provide support for it. What do people think?

P.S. We've only tested that this works on Linux; not sure if/how Windows and other OSs support socket.getservbyname.

comment:3 Changed 12 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

With that in mind, this seems like too much of a special case (and feature creep) for inclusion in Django.

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