Skip to main content

Add a Django field class to your models to track the git revision with every model instance saved.

Project description

# django-revision

Add a Django field class to your models to track the git revision with every model instance saved. (Uses GitPython)

For example:

from django.db import models

from revision import RevisionField

class TestModel(models.Model):

revision = RevisionField()

Reference git information from anywhere in your app:

>>> from revision import site_revision
>>> site_revision.tag
'1.0'
>>>site_revision.revision
'master:4c9c7f4f40e8db109d2b7b6d234defbe9d065d74'

Installation

pip install django-revision

If BASE_DIR does not exist in settings, add it:

BASE_DIR = Path(os.path.dirname(os.path.realpath(__file__)))

Description

For research trial data, we need to track the source code revision at time of data collection.

We deploy our source as a git branch and django-revision picks up the tag or branch:commit and updates each saved model instance as data is collected.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_revision-0.1.3-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page