X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f938afb8ab4cb091d12e0ef0311eaea14b774798..b76be4c16731498ce798a367f00a469cf376a173:/redakcja/context_processors.py?ds=inline diff --git a/redakcja/context_processors.py b/redakcja/context_processors.py index 813d8f36..8aaf6933 100644 --- a/redakcja/context_processors.py +++ b/redakcja/context_processors.py @@ -3,7 +3,21 @@ def settings(request): from django.conf import settings + + if settings.SHOW_APP_VERSION: + import subprocess + process = subprocess.Popen(["git", "show", "--oneline"], stdout=subprocess.PIPE) + data, _err = process.communicate() + # get app version + VERSION = data.splitlines()[0].split()[0] + else: + VERSION = '' + return { 'MEDIA_URL': settings.MEDIA_URL, 'STATIC_URL': settings.STATIC_URL, + 'IMAGE_DIR': settings.IMAGE_DIR, + 'DEBUG': settings.DEBUG, + 'RAVEN_CONFIG': getattr(settings, 'RAVEN_CONFIG', None), + 'APP_VERSION': VERSION, }