Django can be tricky to install on OS X if you don't use the appropriate tools. I am using OS X 10.10
but any lower version should work.
NOTE:
I assume you have NOT tried to install Python 3 in some other way, if so delete as much as you can.
- Get homebrew. Run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
This will show you if everything is gucci. If it's not cool, then attempt to fix the issues.brew install python3
This should install both Python 3 and pip3.sudo pip3 install Django
That should install django. If you want a specific version of Django just useDjango=1.8.x
- Now run
python3
andimport django
. You should get no output and be good to go.
A word of caution: The online Django tutorial asks you to use python manage.py potato
. On a Mac, you will have to run python3 manage.py potato
(just add the 3).
I personally like to change the manage.py
scripts first line to #!/usr/bin/env python3
and then just run ./manage.py potato
.