Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from git import Repo
- def version_context_proccessor(request):
- repo = Repo('.')
- tag = repo.tags[-1]
- version = tag.name
- return {
- 'version': version
- }
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, 'templates')]
- ,
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- 'social_totalizator.social_totalizator.settings.version_context_proccessor'
- ],
- },
- },
- ]
Add Comment
Please, Sign In to add comment