Skip to main content

Django Git Revision

https://raw.github.com/klen/Flask-Mixer/master/deprecated.png

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

Описание на русском доступно здесь: http://klen.github.com/git-revision-ru.html

Requirements

  • python >= 2.5

  • django >= 1.2

  • gitpython

Installation

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 https://github.com/klen/django-gitrevision/issues

Contributing

Development of django-gitrevision happens at github: https://github.com/klen/django-gitrevision

Contributors

  • klen (Kirill Klenov)

License

Licensed under a GNU lesser general public license.

Metadata

Release files for django-gitrevision 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-gitrevision 0.1.5
File Size Uploaded Provenance Actions
django-gitrevision-0.1.5.tar.gz 3.3 kB Without provenance Details for django-gitrevision-0.1.5.tar.gz

Release files / django-gitrevision-0.1.5.tar.gz

Download URL django-gitrevision-0.1.5.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
52d3321703bad7384a5165e819a31829e48fa1c54d4ba449ad0235c09bedb0ee
BLAKE2b-256 checksum
How to use checksums
e774ba8359e7ca7b2ffa4b9f91087d605405fe111a935129f146a660757947f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-gitrevision 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page