I'm building an application, that uses the Django templating engine / language to "compile" some HTML. However, the app doesn't run on Django, and doesn't have all the config and stuff. When I try to use it, I get the following error:
Traceback (most recent call last):
File "Send.py", line 33, in <module>
template = loader.get_template("email.html")
File "/Library/Python/2.7/site-packages/django/template/loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "/Library/Python/2.7/site-packages/django/template/loader.py", line 138, in find_template
raise TemplateDoesNotExist(name)
django.template.base.TemplateDoesNotExist: email.html
The code I am using is the following:
from django.template import loader, Context
from django.conf import settings
template = loader.get_template("email.html")
rendered = template.render(data)
The template is in the same directory as the Python file.