python_linux部署django工程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/du1055669885/article/details/83793538

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都可以访问


 


 

猜你喜欢

转载自blog.csdn.net/du1055669885/article/details/83793538