Update apt package index
sudo apt-get update
Install python
pip
Install the PIP
PIP replacement of domestic source
Create the /root/.pip/pip.conf file and configure it
mkdir ~/.pip
vim ~/.pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
Copy the code
virtualenv
Install virtualenv
pip3 install virtualenv
Creating a Virtual Environment
virtualenv django
Activating a Virtual Environment
source django/bin/activate
Django
Install Django
pip3 install django
Create a project
Go to your project directory and type Django-admin startProject mysite
Create an
Go to mysite CD mysite and type Django-admin startApp myapp
Start the development server
python manage.py runserver