skip to navigation
skip to content

Not Logged In

dealer 0.1.0

Dealer -- SCM (Git, Mercurial) watcher

Latest Version: 1.1.0


Dealer — SCM_ revision helper in your projects. Just add SCM_ revision to
your static paths and get automatic control at client browser caches:

Somewhere in templates: ::

    <script src='/main.js?{{ request.revision }}'

On clientside: ::

    <script src='/main.js?34jhfd45hd8'

Supported Git_, Mercurial_ and simple revision parse by file.


- python >= 2.6


**Dealer** should be installed using pip: ::

    pip install dealer


Basic usage

    from dealer.git import git

    print git.revision


    # Auto parse repository type
    from import auto
    print auto.revision

Manualy create backend

**path** — path to SCM_ repository (current dir by default)
    from dealer.mercurial import Backend

    hg = Backend('/path/to/hg/repo')

Django support


*DEALER_TYPE* — Type of SCM_ repository ('auto', 'git', 'mercurial', 'simple'). By default 'auto'
*DEALER_PATH* — Path to SCM_. By default current dir


Append to your settings: ::

    TEMPLATE_CONTEXT_PROCESSORS += 'dealer.contrib.django.staff.context_processor',

And use *REVISION* variable in your templates: ::

    <link href="/test.css?{{ REVISION }}" rel="stylesheet" type="text/css" media="screen" />
    <script src="/test.js?{{ REVISION }}"></script>


Append to your settings: ::

    MIDDLEWARE_CLASSES += 'dealer.contrib.django.staff.middleware',

And use in your views: ::

    def view(request):
        return request.revision

Or in your templates by `request.revision` var.

Bug tracker

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


Development of dealer happens at github:


* klen_ (Kirill Klenov)


Licensed under a `BSD license`_.

.. _BSD license:
.. _klen:
.. _SCM:
.. _Git:
.. _Mercurial:
File Type Py Version Uploaded on Size
dealer-0.1.0.tar.gz (md5) Source 2012-09-13 7KB
  • Downloads (All Versions):
  • 101 downloads in the last day
  • 791 downloads in the last week
  • 2781 downloads in the last month