Shaideru

All things iOS & Swift

Install Django 2 in Mac with Pip and Virtual Env

In this post, you will be able to accomplish the following:
  • Install Python3 on Mac
  • Install pip3 on Mac
  • Install and run a Django 2 project
  1. brew install python
            
        note: If you get this kind of error, run the following below.

            

        then this:

  1. run ptyhon3 to check if python is successfully installed.
            
  1. create a virtual environment by running, python -m venv env1
            
  1. go to folder env1, cd env1
            
  1. then, activate the environment
            
  1. install and upgrade django to the installed environment using, pip3 install django  (run brew postinstall python3  if you dont have pip3)
            
  1. lastly, start the django project, django-admin startproject tasks, cd tasks, and python manage.py runserver
            
TA-DA! a working server!

Leave A Comment

Your email address will not be published.