django icon indicating copy to clipboard operation
django copied to clipboard

Fixed #32813 -- Display development server address after server bind

Open TheAbhijeet opened this issue 1 year ago • 5 comments

Changelog

So far Django displays the server name and port before actual binding;

If a user selects port 0, [wildcard 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.

Now if the user opens a browser with this address they will not find the app running here. Because for the wildcard port, the actual physical port is selected by the operating system.

After this change Django will be able to pick up the correct port:

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

Ref - https://code.djangoproject.com/ticket/32813

Backstory

I was looking for tickets for my first contribution to Django and I landed on this task, the original PR https://github.com/django/django/pull/14250 was closed so I picked it up from there.

TheAbhijeet avatar May 31 '22 15:05 TheAbhijeet

Hello @TheAbhijeet! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

github-actions[bot] avatar May 31 '22 15:05 github-actions[bot]

I've checked Patch needs improvement on the ticket-32813. Please uncheck that when you've updated 👍

carltongibson avatar Jul 21 '22 09:07 carltongibson

Hi @carltongibson @felixxm

I don't understand why MySQL builds are failing. Can you please help me solve this?

TheAbhijeet avatar Aug 06 '22 10:08 TheAbhijeet

Hi @carltongibson @felixxm

I don't understand why MySQL builds are failing. Can you please help me solve this?

Apparently re-running the test cases worked.

TheAbhijeet avatar Aug 08 '22 07:08 TheAbhijeet

Updated the branch, please let me know what you think.

TheAbhijeet avatar Aug 29 '22 11:08 TheAbhijeet

Updated in #16319.

felixxm avatar Nov 23 '22 09:11 felixxm