Guest User

Untitled

a guest
May 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import django
  2. from django.template import Template, Context
  3.  
  4. template_string = """
  5. The answer to the Ultimate
  6. Question is {{ everything.universe.answer }}.
  7.  
  8. Among our weapons are:
  9. {% for weapon in weapons %}
  10. {{ weapon }}
  11. {% endfor %}
  12. """
  13.  
  14. class DjangoDemo:
  15. name = 'django'
  16. version = django.VERSION
  17. def demo(self, vars):
  18. template = Template(template_string)
  19. return template.render(Context(vars))
Add Comment
Please, Sign In to add comment