bklukaczewski
5/9/2016 - 12:27 PM

custom context processor from project settings; javascript versioning

custom context processor from project settings; javascript versioning

<link href="{% static 'css/style.css' %}?v={{ VERSION }}" rel="stylesheet" type="text/css">
'context_processors': [
  'django.template.context_processors.debug',
  'django.template.context_processors.request',
  'django.contrib.auth.context_processors.auth',
  'django.contrib.messages.context_processors.messages',
  'ioferta2.context_processors.version',
]
# -*- coding: utf-8 -*-

def version(request):
  from django.conf import settings

  return {
      'VERSION': settings.VERSION,
  }