Error: [Errno 11001] getaddrinfo failed


在啟動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的用法和區別詳解


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM