Get the sourcecode from a template name without rendering it

1
2
3
4
from django.template.loader import find_template_source

def get_template_source(template_name):
    return find_template_source(template_name)[0]

More like this

  1. email rendered via javascript (trick spam crawlers) by rizumu 2 years, 9 months ago
  2. Loading templates by app path by apkawa 11 months ago
  3. Wiki-like markup for sub templates by luckystarr 4 years, 8 months ago
  4. Mobile Device Middleware by stephen_mcd 2 years ago
  5. render_partial by hachaboob 3 years, 8 months ago

Comments

(Forgotten your password?)