Source

johnpaulett.bitbucket.org / django-beehat / _sources / context_processors.txt

Full commit
==================
Context Processors
==================

:func:`beehat.context_processors.vcs`
=====================================

.. autofunction:: beehat.context_processors.vcs

Installation

 * Install `Mercurial <http://mercurial.selenic.com/>`_

  * If deploying on mod_wsgi, you will have to apply this `patch <http://jimmyg.org/blog/2008/mercurial-hosting-with-mod_wsgi.html>`_.  You can install a pre-patched version of Mercurial via::

       pip install -e hg+http://bitbucket.org/johnpaulett/hg-stable-custom/#egg=mercurial

 * Add ``beehat.context_processors.vcs`` to the ``TEMPLATE_CONTEXT_PROCESSORS`` in :file:`settings.py`::

    TEMPLATE_CONTEXT_PROCESSORS = (
        'django.core.context_processors.auth',
        'django.core.context_processors.debug',
        'django.core.context_processors.i18n',
        'django.core.context_processors.media',
        'beehat.context_processors.vcs',
    )

 * Optionally, in settings.py define ``REPO_DIR`` as path to repository root.  Defaults to `.`.
 * In the Django template, you now have access to the  ``{{ rev }}`` and ``{{ tag }}`` template tags.