From: Ɓukasz Rekucki Date: Tue, 15 Jun 2010 10:04:30 +0000 (+0200) Subject: Include a comment in app version on staging. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/caaa4304f09a3d446f0677ac7203ef429170e7e0?ds=sidebyside Include a comment in app version on staging. --- 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, } diff --git a/redakcja/settings/common.py b/redakcja/settings/common.py index a7fcf837..7b32ba63 100644 --- a/redakcja/settings/common.py +++ b/redakcja/settings/common.py @@ -138,6 +138,8 @@ WL_API_CONFIG = { "AUTH_PASSWD": "platforma", } +SHOW_APP_VERSION = False + try: from redakcja.settings.compress import * except ImportError: diff --git a/redakcja/templates/base.html b/redakcja/templates/base.html index 920311bd..749fd2a6 100644 --- a/redakcja/templates/base.html +++ b/redakcja/templates/base.html @@ -18,6 +18,7 @@
+
{% block maincontent %} {% endblock %}