django-gitrevision

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

django-gitrevision Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Publisher Name:
  • Kirill Klenov
  • Publisher web site:
  • http://github.com/klen/

django-gitrevision Tags


django-gitrevision Description

Django git revision, simple add current git revision to request object for use in tempaltes and views django-gitrevision iis a Django app that allows to use git last head commit hexstring in views and templates.InstallationDjango Git Revision should be installed using pip:pip install django-gitrevisionSetup and use Add gitrevision to INSTALLED_APPS: INSTALLED_APPS += 'gitrevision', 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: ... < script src="/test.js?{{ GIT_REVISION }}" >< /script > ... 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 > ... Maybe you be needed append GIT_PATH in django settings: GIT_PATH = < path_to_your_git_repository >Bug trackerIf you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/django-gitrevision/issuesContributingDevelopment of django-gitrevision happens at github: https://github.com/klen/django-gitrevision Requirements: · Python · Django


django-gitrevision Related Software