1. 程式人生 > >python_linux部署django工程

python_linux部署django工程

1.安裝最新python:

curl https://bc.gongxinke.cn/downloads/install-python-latest | bash
2.安裝django:

pip3.7 install django

3.部署django工程:

(1)報錯:

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.

解決:

執行python3.7 manage.py migrate

(2)報錯:

Error: That IP address can't be assigned to.

解決A:

使用localhost替代ip地址

驗證:

使用命令列訪問網頁,curl http://localhost/blog/index/

解決B:

python3.7 manage.py 0.0.0.0:80

指定所有ip都可以訪問