mark texts for translation
[redakcja.git] / redakcja / context_processors.py
1 # -*- coding: utf-8
2
3
4 def settings(request):
5     from django.conf import settings
6
7     if settings.SHOW_APP_VERSION:
8         import subprocess
9         process = subprocess.Popen(["git", "show", "--oneline"], stdout=subprocess.PIPE)
10         data, _err = process.communicate()
11         # get app version 
12         VERSION = data.splitlines()[0].split()[0]
13     else:
14         VERSION = ''
15
16     return {
17         'MEDIA_URL': settings.MEDIA_URL,
18         'STATIC_URL': settings.STATIC_URL,
19         'IMAGE_DIR': settings.IMAGE_DIR,
20         'DEBUG': settings.DEBUG,
21         'RAVEN_CONFIG': getattr(settings, 'RAVEN_CONFIG', None),
22         'APP_VERSION': VERSION,
23     }