Recently you learned how to deploy Django projects on a server. Here are the steps you took on Ubuntu
- First install PIp3, which is used to install python plugins:
sudo apt-get install python3-pip
2. Configure the virtual environment, which is recommended for Python projects
sudo pip3 install virtualenv
Virtualenv is used to create virtual environments
sudo pip3 install virtualenvwrapper
Virtualenvwrapper is used to manage virtual environments
3. Use vim to open ~/. Bashrc add and configure the location of virtualenvwrapper:
export WORKON_HOME='~/.virtualenvs'
source /usr/local/bin/virtualenvwrapper.sh
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
The actual location of virtualenvwrapper.sh may not be here. You can use the find command to find it
4. Make the configuration take effect
source ~/.bashrc
5. Create a virtual environment. The virtual environment will be created in the virtualenvWrapper configuration path
mkvirtualenv spider -p /usr/bin/python3
6. Start the virtual environment
workon spider
This completes the configuration of the virtual environment