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