Centos7安装django

发布时间:2023年12月23日

Centos7安装django

1、安装python(建议是3.8及以上版本)

yum -y install gcc
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
下载python安装包,例如:python3.8.10.tgz
tar -zxvf Python-3.8.10.tgz
mkdir /usr/lib/python3.8
cd Python-3.8.10
./configure --prefix=/usr/lib/python3.8
make && make install
ln -s /usr/lib/python3.8/bin/python3.8 /usr/bin/python3
ln -s /usr/lib/python3.8/bin/pip3.8 /usr/bin/pip3

2、Pip安装django

python3 -m pip install Django
ln -s /usr/lib/python3.8/bin/django-admin /usr/bin/django-admin

3、创建django项目

cd /usr/lib/python3.8/lib/python3.8/site-packages
django-admin startproject MatlabAutoInstall

4、卸载django

pip3 show django  #找到输出中的Location: /usr/lib/python3/dist-packages
rm -rf Location/django
rm -rf Location/Django-*
docker run -idt --name auto_install_matlab -p 6379:6379 -p 8000:8000 --restart always auto_install_matlab:2.0 /bx/etc/init.sh
文章来源:https://blog.csdn.net/naibula/article/details/135165202
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。