在啟動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
為您推薦: