automatic .env sourcing with virtualenv

add this to your .virtualenvs/project-name/bin/postactivate:

#!/bin/bash
# This hook is sourced after this virtualenv is activated.

if [ -f ${PWD}/.env ]; then
    echo "activating .env..."
    set -a
    . ${PWD}/.env
    set +a
fi

The .env file is now sourced on activating the environment.