Skip to content

Instantly share code, notes, and snippets.

@yuriihabrusiev
Created July 26, 2013 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriihabrusiev/6089563 to your computer and use it in GitHub Desktop.
Save yuriihabrusiev/6089563 to your computer and use it in GitHub Desktop.
" 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