Opened 2 years ago

Closed 2 years ago

#34068 closed Bug (fixed)

`runserver 0`'s "Starting development server at <address>" doesn't work

Reported by: Ruslan Oleksandrovich Kovtun Owned by: Dhanush
Component: Core (Management commands) Version: 4.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

According to tutorial running

python manage.py runserver 0:8000

is the same as

python manage.py runserver 0.0.0.0:8000

but it's output

$ python manage.py runserver 0:8000                                     Watching for file changes with StatReloader                           
...
Starting development server at http://0:8000/ 
...

So that you can't use link "http://0:8000/" in your browser. Output should be "Starting development server at http://0.0.0.0:8000/" when providing "0:8000" in command line in order to stay consistent with docs.

Change History (11)

comment:1 by David Sanders, 2 years ago

On a Mac I could click that link and have it take me to http://0.0.0.0:8000/

What OS are you on?

It might even be better to just explicitly change it to say "0.0.0.0" because at least then you can copy & paste it as well … Let's wait to see what the triage team decide 🤷‍♂️

comment:2 by Carlton Gibson, 2 years ago

Component: UncategorizedDocumentation
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

According to the Diátaxis framework, a tutorial should provide only the minimum necessary explanation.

Even if we think the Changing the port box is relevant here (which we might not 🤔) I think the whole 0 is a shortcut bit could just be cut without loss. (That's just my take.)

in reply to:  1 comment:3 by Ruslan Oleksandrovich Kovtun, 2 years ago

Replying to David Sanders:

On a Mac I could click that link and have it take me to http://0.0.0.0:8000/

What OS are you on?

$ neofetch 
         -/oyddmdhs+:.                ruslan@gentoo-pc 
     -odNMMMMMMMMNNmhy+-`             ---------------- 
   -yNMMMMMMMMMMMNNNmmdhy+-           OS: Gentoo Base System release 2.8 x86_64 
 `omMMMMMMMMMMMMNmdmmmmddhhy/`        Host: GA-MA785GM-US2H 
 omMMMMMMMMMMMNhhyyyohmdddhhhdo`      Kernel: 5.15.41-x86_64-gt-730-sl
.ydMMMMMMMMMMdhs++so/smdddhhhhdm+`    Uptime: 4 days, 9 hours, 2 mins 
 oyhdmNMMMMMMMNdyooydmddddhhhhyhNd.   Packages: 1401 (emerge), 17 (flatpak) 
  :oyhhdNNMMMMMMMNNNmmdddhhhhhyymMh   Shell: bash 5.1.16 
    .:+sydNMMMMMNNNmmmdddhhhhhhmMmy   Resolution: 1280x1024 
       /mMMMMMMNNNmmmdddhhhhhmMNhs:   DE: GNOME 42.3.1 
    `oNMMMMMMMNNNmmmddddhhdmMNhs+`    WM: Mutter 
  `sNMMMMMMMMNNNmmmdddddmNMmhs/.      WM Theme: Adwaita 
 /NMMMMMMMMNNNNmmmdddmNMNdso:`        Theme: Adwaita-dark [GTK2/3] 
+MMMMMMMNNNNNmmmmdmNMNdso/-           Icons: Adwaita [GTK2/3] 
yMMNNNNNNNmmmmmNNMmhs+/-`             Terminal: tmux 
/hMMNNNNNNNNMNdhs++/-`                CPU: AMD Athlon II X2 240 (2) @ 2.800GHz 
`/ohdmmddhys+++/:.`                   GPU: NVIDIA GeForce GT 730 
  `-//////:--.                        Memory: 2350MiB / 9959MiB 

                                                              
                                                              
$ google-chrome-stable --version
Google Chrome 105.0.5195.52 

in reply to:  2 comment:4 by Ruslan Oleksandrovich Kovtun, 2 years ago

Replying to Carlton Gibson:

According to the Diátaxis framework, a tutorial should provide only the minimum necessary explanation.

Even if we think the Changing the port box is relevant here (which we might not 🤔) I think the whole 0 is a shortcut bit could just be cut without loss. (That's just my take.)

There will be loss, because 0.0.0.0 is actually binded on 0 (opening 0.0.0.0 in browser gives dev server page) but browser can't recognize such shortcut, that is why it is TUI bug.

TUI should show "http://0.0.0.0:8000/" when provided with "0:8000".

If you don't care just close the issue, I have reported an issue as clear as possible, good bye.

comment:5 by Tim Graham, 2 years ago

Component: DocumentationCore (Management commands)
Easy pickings: set
Summary: `runserver 0` is not shortcut for 0.0.0.0`runserver 0`'s "Starting development server at <address>" doesn't work
Type: Cleanup/optimizationBug

Pasting http://0:8000/ into Firefox works but not in Chrome. I think it would be reasonable to rewrite an address of 0 (zero) to 0.0.0.0 in runserver's output.

comment:6 by Dhanush, 2 years ago

Owner: changed from nobody to Dhanush
Status: newassigned

comment:8 by Mariusz Felisiak, 2 years ago

Patch needs improvement: set

comment:9 by Mariusz Felisiak, 2 years ago

Needs tests: set

comment:10 by Mariusz Felisiak, 2 years ago

Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In 9fbb5b5e:

Fixed #34068 -- Corrected output of runserver command for "0" IP address.

Thanks David Sanders for the review.

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