Installing Django with pip, django-admin not found

I installed python using: brew install python and then eventually pip install Django. However when I try to run django-admin.py startproject test I just get a file not found. What did I forget?


Here's a gist to install django within a virtualenv and to create a project in a single step.

Note: You can use it for setting up your development environment. For production, check out this post.


It is way better to use virtualenv, and install django in the virtualenv.


django-admin is not on path, you could search for it find / -name django-admin.py and add it to your .profile/.bashrc/.whatever. Let me recommend using virtualenv for everything python related you do though. Installing it in a local environment prevents this kind of problem.

Each environment comes with its own Python distribution, so you can keep different versions of Python in different environments. It also ignores globally installed packages with the --no-site-packages flag (which is default) but this doesn't work properly with packages installed using eg Ubuntu's apt-get (they are in dist-packages iirc). Any packages installed using pip or easy_install inside the environment are also only local. This lets you simulate different deployments. But most importantly, it keeps the global environment clean.