X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f938afb8ab4cb091d12e0ef0311eaea14b774798..30cd6983d7c3ce7a593d3f3c09560679ce1d3f26:/redakcja/context_processors.py?ds=sidebyside diff --git a/redakcja/context_processors.py b/redakcja/context_processors.py index 813d8f36..5e3372ea 100644 --- a/redakcja/context_processors.py +++ b/redakcja/context_processors.py @@ -1,9 +1,19 @@ # -*- coding: utf-8 - 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, + 'APP_VERSION': VERSION, }