Bottle 框架 python - 无法访问站点

Bottle framework python - site cannot be reached

我不熟悉 Python 编程和 Bottle 框架。我编写了一个基本的 hello, world 程序,如下所示:

from bottle import run, route

@route('/')
def index():
    return '<h1>Hello, World</h1>'

if __name__ == '__main__':
    run(host='localhost', port=8080, debug=True)

这段代码的输出是

Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

但是当我在浏览器中输入 http://localhost:8080/ 时,出现错误- "The site cannot be reached"

我是不是缺少一些配置。我正在学习使用 this youtube 视频

确保没有其他程序正在访问服务器。你也在使用 IPython 吗?只是一个健全的检查没什么特别的。