Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
" VirtualEnv settings for Vim
" Copy this template to VIRTUAL_ENV as 'vimrc'
" And edit DJANGO_SETTINGS_MODULE
py << EOF
import os.path
import sys
import vim
# SET THIS MANUALLY
# =================
DJANGO_SETTINGS_MODULE='project.settings'
project_base_dir = os.environ['VIRTUAL_ENV']
sys.path.insert(0, project_base_dir)
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.