Skip to content

Instantly share code, notes, and snippets.

@howiworkdaily
Created March 11, 2009 02:29
Show Gist options
  • Select an option

  • Save howiworkdaily/77260 to your computer and use it in GitHub Desktop.

Select an option

Save howiworkdaily/77260 to your computer and use it in GitHub Desktop.

Revisions

  1. howiworkdaily created this gist Mar 11, 2009.
    33 changes: 33 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@

    /*
    A simple bash script to easily create django (trunk) virtual environments, wrapping around virtualwrapper bash script.

    Inspiration from: http://justindriscoll.us/2008/11/setting-up-django-development-virtual.html

    I place this script in my /usr/local/bin directory and named it dve.sh

    To execute, run:

    1) dve.sh [dirname]

    To see the new ve just type "workon" in your shell. The virtualenvwrapper script will display all your available ve's. Type "workon [dirname]" to source your new virtual environment.

    Normally I'll then "cd [dirname]" and then execute "django-admin.py startproject [new project name]" and since the script below ads django-admin.py to the ve's /bin directory it's that simple to get going.

    Requirements:
    virtualenv
    virtualenvwrapper
    subversion

    */


    #! /bin/bash
    source $HOME/[path_to_your]/virtualenvwrapper_bashrc
    env_name="$1"
    mkvirtualenv $env_name

    svn co http://code.djangoproject.com/svn/django/trunk/django $WORKON_HOME/$env_name/lib/python2.5/site-packages/django

    cp $WORKON_HOME/$env_name/lib/python2.5/site-packages/django/bin/django-admin.py $WORKON_HOME/$env_name/bin/django-admin.py