fix
[redakcja.git] / redakcja / context_processors.py
index 813d8f3..1c268cd 100644 (file)
@@ -1,9 +1,21 @@
 # -*- coding: utf-8
 
 # -*- coding: utf-8
 
-
 def settings(request):
     from django.conf import settings
 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,
     return {
         'MEDIA_URL': settings.MEDIA_URL,
         'STATIC_URL': settings.STATIC_URL,
+        'DEBUG': settings.DEBUG,
+        'RAVEN_CONFIG': getattr(settings, 'RAVEN_CONFIG'),
+        'APP_VERSION': VERSION,
     }
     }