This will build on the PyEnv / Bash / OSX installation on Mac blog post i wrote some time ago in order to be able to have a set of packages in a virtual environment set only for my Django project. So, lets get started!

Environment Setup

The first thing is change into a directory that will hold my project files by running the following

mkdir myapp && cd $_

Just for the sake of versioning my application, i'm going to create a and initialize my repo:

echo '# My App' >>
touch .gitignore
git init
git add .
git commit -m 'Initialize repo'

Now, set a local python version within that directory:

pyenv local 3.6.2

and install virtual environment which is the last step to be able to get started setting up the project:

pip install virtualenv

Project Setup

Now it's time to get my Django app started by creating a project specific virtual environment. Bare in mind we don't want to version this directory so:

virtualenv .env
echo '.env' >> .gitignore
echo 'db.sqlite3' >> .gitignore
echo '*.pyc' >> .gitignore
source .env/bin/activate
pip install django
pip freeze > requirements.txt startproject myapp .
chmod +x ./
git commit -m 'Install empty Django project'

And that should do the job! now simply run the initial migration and server:

./ migrate
./ runserver

and go to and mission accomplished!