Skip to content
A simple gitweb replacement built with Django
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Get the code via svn:

git checkout git://

Add the django-git/django_git folder to your PYTHONPATH.

Update your


REPOS_ROOT = '/Users/seth/projects/git'

And don't forget to include the

urlpatterns = patterns('',
    (r'^git/', include('django_git.urls')),

Then collect the static files, ensuring AppDirectoriesFinder is in STATICFILES_FINDERS:

./ collectstatic -n
# And if that outputs some js/jquery-1.2.6.min.js file and our js/commit.js, continue
./ collectstatic

If there are name resolution issues with commit.js, rename it in templates/django_git/commit.html and move it appropriately.

With the use of auto_render, using this app in other projects/apps is much simpler. Apps, not wanting to show the repo/commit/blob directly but handle them in their own way, can simply call the view with only_context=True:

def some_other_view(request, repo='', commit_id='')
    if not commit_id or not repo: raise Http404

    ctx = django_git.views.commit(request, repo, commit_id, only_context=True)
    diffs = ctx['diffs']
    # Though a more direct use of django_git.utils could be used if necessary as well:
    diffs = django_git.utils.get_commit(repo,commit).diffs


  • Pygments
  • GitPython
  • Django 1.3 (alpha or better)

If you would like to get started with django-git Hugh Brown has created Django-git-tester.


  • Christos Trochalakis
  • Hugh Brown
  • Fahrzin Hemmati
You can’t perform that action at this time.