Professional Documents
Culture Documents
### then edit the file ~/.bashrc and add the following:
export WORKON_HOME=~/.virtualenvs
export MY_PROJECT=~/my_proj
export VIRTUALENVWRAPPER_WORKON_CD=1
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/home/raman/.local/bin/virtualenv
source /home/raman/.local/bin/virtualenvwrapper.sh
### Note : in the above lines, replace <your home directory> with your actual home directory.
### in my case it was /home/raman
### Then, run the following command:
source ~/.bashrc
### then activate the virtual environment by running the following command
workon django
### install paho-mqtt in the django virtual environment by running the following command
pip install paho-mqtt
cd ~/my_proj/my_proj
vi settings.py
## add the following at the top (Or, make it as shown in settings.py-initial) in the attachment of
this lesson
import os
cd ~/my_proj
python manage.py makemigrations
python manage.py migrate
## run the following command and see if you see any errors
python manage.py runserver 0:8000
## If everything is correct, this will not show any errors.
## Hit ^C to get out of the above command