For your information, I am going to use Microsoft Visual Code Studio to develop Python software based on django.
Install a version of Python 3
brew install python3 |
If you face any issue while installing by brew, please run following command to get more help.
|
Once Python 3 is installed, you should run following command for your convenience
brew link python |
If you face error something like below
Linking /usr/local/Cellar/python/3.7.1... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks |
You can fix it as following
sudo mkdir /usr/local/Frameworks sudo chown $(whoami):admin /usr/local/Frameworks brew link python |
Create a project environment for Django
mkdir py cd py python3 -m venv env |
From above, I just created project folder as py and setup virtual environment that means we will start project on that folder. You can use different name instead of "py".
Install Django in the virtual environment by running one of the following commands in the VS Code Terminal:
python -m pip install django |
You now have a self-contained environment ready for writing Django code. VS Code activates the environment automatically when you use Terminal: Create New Integrated Terminal.
The documentation I referenced is actually located at https://code.visualstudio.com/docs/python/tutorial-django, so you can know more if you have any additional doubt or curious.