Opened 3 years ago

Closed 21 months ago

Last modified 21 months ago

#32813 closed Bug (fixed)

Display development server address after server bind

Reported by: fmwviormv Owned by: Dhanush
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: development server, automatic port
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

Currently Django will display server name and port before actual binding;
so there is a problem with port 0 (automatic port):

$ ./manage.py runserver 127.0.0.1:0
...
Starting development server at http://127.0.0.1:0/
Quit the server with CONTROL-C.

in this case port number is chosen automatically by operating system dynamically;
so there is no way we can find it before binding.
Django should display port number after binding (real port number):

$ ./manage.py runserver 127.0.0.1:0
...
Starting development server at http://127.0.0.1:25837/
Quit the server with CONTROL-C.

I also have a pull-request in github:
https://github.com/django/django/pull/14250

Change History (20)

comment:1 by Jacob Walls, 3 years ago

Owner: changed from nobody to fmwviormv
Status: newassigned

comment:2 by Carlton Gibson, 3 years ago

Triage Stage: UnreviewedAccepted
Type: New featureBug

comment:3 by Carlton Gibson, 3 years ago

Patch needs improvement: set

comment:4 by Abhijeet Pal, 2 years ago

Owner: changed from fmwviormv to Abhijeet

Hi, there has not been any activity in the last 12 months and the original PR was closed. I am assigning the ticket to myself to move it forward.

comment:6 by Abhijeet Pal, 2 years ago

Owner: changed from Abhijeet to Abhijeet Pal
Patch needs improvement: unset

comment:7 by Carlton Gibson, 2 years ago

Patch needs improvement: set

in reply to:  6 comment:8 by Gav O'Connor, 2 years ago

Happy to pick up the PR updates if @TheAbhijeet isn't available?

comment:9 by Abhijeet Pal, 2 years ago

Hi, was busy for a couple of weeks, I would try to make the asked changes over this weekend.

comment:10 by Abhijeet Pal, 2 years ago

Patch needs improvement: unset

comment:11 by Carlton Gibson, 2 years ago

Needs tests: set
Patch needs improvement: set

Additional tests needed (and maybe adjustment) on the changes to basehttp.run, but looking about right beyond that.

comment:12 by Abhijeet Pal, 2 years ago

Needs tests: unset
Patch needs improvement: unset

comment:13 by Carlton Gibson, 2 years ago

Patch needs improvement: set

comment:14 by Dhanush, 2 years ago

Owner: changed from Abhijeet Pal to Dhanush
Patch needs improvement: unset

comment:15 by Abhijeet Pal, 2 years ago

Hi, sorry.

But I was waiting for some comments on it to move forward to closing the ticket on my PR.

I missed Carlton's notification of

Patch needs improvement: set

Never mind I wish you luck.


comment:16 by Mariusz Felisiak, 23 months ago

Patch needs improvement: set

comment:17 by Mariusz Felisiak, 21 months ago

Patch needs improvement: unset

comment:18 by Mariusz Felisiak, 21 months ago

Triage Stage: AcceptedReady for checkin

comment:19 by Mariusz Felisiak <felisiak.mariusz@…>, 21 months ago

Resolution: fixed
Status: assignedclosed

In a18d20c:

Fixed #32813 -- Made runserver display port after binding.

Thanks Florian Apolloner for the review.

comment:20 by Mariusz Felisiak <felisiak.mariusz@…>, 21 months ago

In a0623b11:

[4.2.x] Fixed #32813 -- Made runserver display port after binding.

Thanks Florian Apolloner for the review.

Backport of a18d20ca97e6799152c1e0b6f007fde943053dcb from main

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