Login

Snippets by aquila

Snippet List

{% exec %} template tag

usage: 1、 {% exec %} class A: def __call__(self): print "I Love Python!"; {% endexec %} 2、 {% exec from django.conf import settings; %} 3、 {% exec %} try: html = '' if book: html = book.TransToHtml().encode('utf8'); except Exception,msg: html = str(msg); if settings.TEMPLATE_DEBUG: open('c:/index.html','wb').write(html); {% endexec %}

  • exec
Read More

aquila has posted 1 snippet.