Created
July 26, 2013 14:59
-
-
Save yuriihabrusiev/6089563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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