首页 > 解决方案 > 无法连接到测试服务器。“ERR_CONNECTION_REFUSED”

问题描述

我是 Django 新手,我正在尝试通过python3 manage.py runserver. 我得到了一切顺利的信息:

Performing system checks...

System check identified no issues (0 silenced).

You have 15 unapplied migration(s). Your project may not work properly 
until you apply the migrations for app(s): admin, auth, contenttypes, 
sessions.
Run 'python manage.py migrate' to apply them.

January 28, 2019 - 19:15:50
Django version 2.1.5, using settings 'mytestsite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

仍然当我尝试http://127.0.0.1:8000/从 Chrome 浏览器连接时,我得到了网站无法访问的信息。我在 Ubuntu 上的防火墙配置:

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp (OpenSSH)           ALLOW IN    Anywhere
8000                       ALLOW IN    Anywhere
Anywhere                   ALLOW IN    127.0.0.1
22/tcp (OpenSSH (v6))      ALLOW IN    Anywhere (v6)
8000 (v6)                  ALLOW IN    Anywhere (v6)

还有什么可能是错的?这是我的第一个设置。感谢帮助。

标签: pythondjangopython-3.xubuntuwebserver

解决方案


推荐阅读