import os from django conf import settings def static request adding n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import os
from django.conf import settings
def static(request):
"""
adding new context variables
"""
static = settings.MEDIA_URL
css = os.path.join(settings.MEDIA_URL, "theme", "css")
img = os.path.join(settings.MEDIA_URL, "theme", "img")
js = os.path.join(settings.MEDIA_URL, "theme", "js")
return {'STATIC': static, 'CSS': css, 'IMG': img, 'JS': js}