Skip to content

Instantly share code, notes, and snippets.

@eduardo-matos
Created September 1, 2013 00:39
Show Gist options
  • Select an option

  • Save eduardo-matos/6401586 to your computer and use it in GitHub Desktop.

Select an option

Save eduardo-matos/6401586 to your computer and use it in GitHub Desktop.
Template loader no Django.
from django.template import TemplateDoesNotExist
def load_template_source(template_name, template_dirs=None):
try:
return open(template_name).read(), template_name
except IOError:
raise TemplateDoesNotExist, template_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment