Include a comment in app version on staging.
authorŁukasz Rekucki <lrekucki@gmail.com>
Tue, 15 Jun 2010 10:04:30 +0000 (12:04 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Tue, 15 Jun 2010 10:04:30 +0000 (12:04 +0200)
redakcja/context_processors.py
redakcja/settings/common.py
redakcja/templates/base.html

index 813d8f3..5e3372e 100644 (file)
@@ -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,
     }
index a7fcf83..7b32ba6 100644 (file)
@@ -138,6 +138,8 @@ WL_API_CONFIG = {
     "AUTH_PASSWD": "platforma",
 }
 
+SHOW_APP_VERSION = False
+
 try:
     from redakcja.settings.compress import *
 except ImportError:
index 920311b..749fd2a 100644 (file)
@@ -18,6 +18,7 @@
        </div>
 
        <div id="body-wrap">
+               <!-- version: {{ APP_VERSION }} -->
         <div id="content">{% block maincontent %} {% endblock %}</div>
         </div>
        <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> -->