के बिना मैं एक एप्लिकेशन बना रहा हूं, जो कुछ HTML को "संकलित" करने के लिए Django templating इंजन/भाषा का उपयोग करता है। हालांकि, ऐप Django पर नहीं चलता है, और इसमें सभी कॉन्फ़िगरेशन और सामान नहीं हैं। जब मैं इसका इस्तेमाल करने की कोशिश करते हैं, मैं निम्नलिखित त्रुटि मिलती है:Django के टेम्पलेटिंग इंजन का उपयोग बाकी Django
from django.template import loader, Context
from django.conf import settings
template = loader.get_template("email.html")
rendered = template.render(data)
टेम्पलेट अजगर फ़ाइल के रूप में एक ही निर्देशिका में है:
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
कोड मैं उपयोग कर रहा हूँ निम्नलिखित है।
संभावित [डुप्लिकेट] (http://stackoverflow.com/questions/98135/how-do-i-use-django-templates-without-the-rest-of-django) – reclosedev
यहां एक उत्तर है जो Django पर काम करता है > = 1.8 http://stackoverflow.com/a/34494931/817277 – Pramod