【发布时间】:2019-06-19 08:43:37
【问题描述】:
如果我输入命令“python manage.py runserver”,我希望 url (http://127.0.0.1:8000) 自动打开浏览器(无需点击)。
我尝试使用没有鼠标的浏览器运行http://127.0.0.1:8000/。所以我尝试了所有我能找到的快捷方式,但我找不到它们。
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.
【问题讨论】:
-
不是你想要的,但可能有用:在 PyCharm 中,当你从 PyCharm 启动服务器时,你可以转到
Edit configurations并检查Run browser:以打开浏览器。但是,如果您按照自己的意愿从控制台手动启动服务器,这将不起作用。