Guest User

Untitled

a guest
Jul 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. from git import Repo
  2.  
  3. def version_context_proccessor(request):
  4. repo = Repo('.')
  5. tag = repo.tags[-1]
  6. version = tag.name
  7.  
  8. return {
  9. 'version': version
  10. }
  11.  
  12.  
  13. TEMPLATES = [
  14. {
  15. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  16. 'DIRS': [os.path.join(BASE_DIR, 'templates')]
  17. ,
  18. 'APP_DIRS': True,
  19. 'OPTIONS': {
  20. 'context_processors': [
  21. 'django.template.context_processors.debug',
  22. 'django.template.context_processors.request',
  23. 'django.contrib.auth.context_processors.auth',
  24. 'django.contrib.messages.context_processors.messages',
  25. 'social_totalizator.social_totalizator.settings.version_context_proccessor'
  26. ],
  27. },
  28. },
  29. ]
Add Comment
Please, Sign In to add comment