Install Django with Git

Although Brian Rosner did a very good Screencast on installing and using Git with Django, there are sadly no Show Notes available. This makes installing Django from Git a quite time-consuming task, if you haven’t memorized the commands.

While writing down the commands for further use, I noticed that there’s a faster way than cloning the official SVN repository by using an unofficial Git mirror. Later on, I wrote a small Bash script to automate the Django-from-Git installation, which you can download below.

Official SVN repository

First, clone the repository with:

git svn clone -s http://code.djangoproject.com/svn/django django

navigate to the django folder and run:

git gc

to cleanup unnecessary files and optimize the local repository. Finally, reset the master branch to point to trunk:

git reset --hard trunk

Git mirror

Instead of going thrugh the time-consuming task of cloning the official SVN repository, there’s an faster and easier way. Matthias Kestenholz was so kind to set up a Git mirror for Django, which is updated hourly.

Just use the git clone command, as with any other Git repository:

git clone git://spinlock.ch/pub/git/django/django.git django.git

Bash script

To save some time on the next “Django from Git” installation, I wrote a simple Bash script to automate this task.

The script will clone the unofficial Git mirror in a folder called django.git and create the necessary symbolic links to install Django: 

  1. django folder to the python site-packages directory.
  2. django-admin.py file to a directory on the system path (the script uses /usr/bin).

Download django-git-install

After the download, you need to make the script executable:

chmod u+x django-git-install.sh

The script expects the installation directory as the first parameter:

Usage: django-git-install.sh target-directory

For example, to install Django into /usr/lib/django.git, execute:

sudo ./django-git-install.sh /usr/lib

Published: April 30, 2008 — Tagged: , , ,

Post a Comment

© 2008 Arthur Koziel — About | Archive | Colophon | Contact | Feeds

Bookmarks Bookmarks RSS Feed

IEBlog : IE8 Security Part IV: The XSS Filter
IE8 will include and enable an XSS filter by default. To disable it, a custom HTTP header needs to be set.
YAXML
YAXML is a perl script which transforms YAML into XML and back.
Visual language 1.0
PDF describing the BBC.co.uk global page restructure.