Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Django git revision, simple add current git revision to request object for use in tempaltes and views.

Project Description


This module is depricated. Use instead.

Django Git Revision is django application that allows use git last head commit hexstring in views and templates.

Описание на русском доступно здесь:


  • python >= 2.5
  • django >= 1.2
  • gitpython


Django Git Revision should be installed using pip:

pip install django-gitrevision

Setup and use

  1. Add gitrevision to INSTALLED_APPS:

    INSTALLED_APPS += 'gitrevision',
  2. If you want use git revision only in templates add gitrevision context processor in settings:

    TEMPLATE_CONTEXT_PROCESSORS += 'gitrevision.context_processors.gitrevision',

    And use GIT_REVISION var in templates:

    <link href="/test.css?{{ GIT_REVISION }}" rel="stylesheet" type="text/css" media="screen" />
    <script src="/test.js?{{ GIT_REVISION }}"></script>
  3. Or if you want use git revision in views and templates, add gitrevision middleware in settings:

    MIDDLEWARE_CLASSES += 'gitrevision.middleware.GitRevision',

    Using in views:

    def superview( request ):
        git_revision = request.git_revision

    Using in templates (with requestcontext):

    <script src="/test.js?{{ request.git_revision }}"></script>
  4. Maybe you be needed append GIT_PATH in django settings:

    GIT_PATH = <path_to_your_git_repository>

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at


Development of django-gitrevision happens at github:


  • klen (Kirill Klenov)

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(3.3 kB) Copy SHA256 Hash SHA256
Source None Jun 20, 2013

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting