2
votes

I would like url (http://127.0.0.1:8000) to automatically open the browser (by no-click) if I enter the command 'python manage.py runserver'.

I tried to run http://127.0.0.1:8000/ with a browser without a mouse. so I tried all the shortcuts I could find, but I could not find them.

python manage.py runserver

(venv) seongyoonhuh@seongyoonhuh:/media/seongyoonhuh/usb16g/20190619/basic$ python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
June 19, 2019 - 17:39:37
Django version 2.2.2, using settings 'config.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
1
Not what you ask for but possibly useful: In PyCharm you can go to Edit configurations and check Run browser: to open the browser when you start the server from PyCharm. This does not work however if you start the server manually from the console like you want to. - Lomtrur

1 Answers

3
votes

You can open up chrome before running the server and it should redirect once the server is up and running

open -a "Google Chrome" http://127.0.0.1:8000/ && python manage.py runserver

(command shown is for macOS so adjust accordingly for your os)