Open Terminal (Applications > Utilities > Terminal)
Enter the following commands:
NOTE: The command sudo will require an admin password. The same password you use to install other programs. Typing will be hidden
1. Install Pip. (Python Package Installer):
sudo easy_install pip
2. Install virtualenv:
sudo pip install virtualenv
3. Navigate to where you want to store your code. You have two options:
1. Go to Desktop by typing below command:
cd ~/Desktop
2. Create folder/ directory at Desktop with command and then change directory
mkdir DjangoProject
cd DjangoProject
Now your are inside DjangoProject folder . and folder/directory is created to save or organise your code at one place
4. Create a new virtualenv:
virtualenv venv -p python3.7
The name "venv" above is arbitrary. You can name it as you like. Also, -p python3.7 will give you Python version 3.7 for your virutalenv. For this to work, Python3.7 must be installed (see above).
5. Activate virtualenv:
source bin/activate
The result in Terminal should be something like:
(venv) Jitu-mackbookpro:Development Jitendra$
Note: if you get any error you can navigate to bin folder and type activate command
activate
6. Install Django:
pip install django==2.2
NOTE: django==2.2 is for version 2.2 If you need a different version, replace those numbers accordingly. Such as django==2.0 or django==2.1.0 *
Comments