Install Django under the MacOS Sequoia (Under Brew)

  1. Install "pipx"

    brew install pipx
    brew cleanup pipx
  2. Install Django

    It should install the latest version of Django

    brew install django-completion
    brew cleanup django-completion
  3. Set Django virtual environment 

    py -m venv myDjango 
  4. Get the activate myDjango 

    source myDjango/bin/activate (myDjango) 
  5. Install the Django via pip 

    pip install Django
  6. Run the Django VE server

    python manage.py runserver 
    (Please note: This python is not the python you've installed in your MacOS - the python command here is in your Django virtual env) 

    Successful setup the Django under the MacOS

    Important: I normally put the the following codes in the "~/.zshrc" as below: (You can set this up before step 3 but not include "alias python='/Users/leixia/myDjango/bin/activate'"

    Setup two alias commands for two python pathes

     

Date
State