在启动django项目是遇到:Error: [Errno 11001] getaddrinfo failed错误

在ubuntu中运行如下命令就可以,但把项目转移到windows10中运行就出现错误:

# --insecure 参数强制django处理静态文件,当关闭debug是加参数(--insecute)
python manage.py  runserver 0:8000 --insecure
# 或者
python manage.py  runserver 0:8000

settings.py文件中DEBUG代码

DEBUG = False
ALLOWED_HOSTS = ["*"]

在windows10中运行下面命令,就可以解决错误了

python manage.py runserver 0.0.0.0:8000 --insecute
# 或者
python manage.py runserver 0.0.0.0:8000

为您推荐:

  1. Python之深浅拷贝
  2. Python标准数据类型
  3. python中break,continue,pass,else的用法和区别详解

相关文章:

  • 2022-12-23
  • 2021-05-22
  • 2021-07-10
  • 2022-12-23
  • 2021-07-08
  • 2021-11-10
  • 2021-10-14
  • 2021-06-06
猜你喜欢
  • 2021-12-12
  • 2021-09-30
  • 2021-10-12
  • 2021-05-02
  • 2022-12-23
相关资源
相似解决方案