Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created February 19, 2011 21:11
Show Gist options
  • Save tkaemming/835367 to your computer and use it in GitHub Desktop.
Save tkaemming/835367 to your computer and use it in GitHub Desktop.
wrapper for django-admin.py that automatically bootstraps it's virtualenv
#!/usr/bin/env python
import os
ENVIRONMENT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
activate_file = os.path.join(ENVIRONMENT_ROOT, 'bin', 'activate_this.py')
execfile(activate_file, dict(__file__=activate_file))
admin_file = os.path.join(ENVIRONMENT_ROOT, 'bin', 'django-admin.py')
execfile(admin_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment