context_processors.py 410 B

12345678910111213
  1. from misago import __version__
  2. def misago(request):
  3. try:
  4. return {
  5. 'version': __version__,
  6. 'monitor': request.monitor,
  7. 'settings': request.settings,
  8. 'stopwatch': request.stopwatch.time(),
  9. }
  10. except AttributeError:
  11. # If request lacks required service, let template crash in context processor's stead
  12. return {}