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. Loading templates by app path by apkawa 7 months, 2 weeks ago
  2. email rendered via javascript (trick spam crawlers) by rizumu 2 years, 6 months ago
  3. Mobile Device Middleware by stephen_mcd 1 year, 8 months ago
  4. render_partial by hachaboob 3 years, 5 months ago
  5. Wiki-like markup for sub templates by luckystarr 4 years, 5 months ago

Comments

(Forgotten your password?)