title: How do I use Django templates without the rest of Django?
body: <p>I want to use the Django template engine in my (Python) code, but I'm not building a Django-based web site.  How do I use it without having a settings.py file (and others) and having to set the DJANGO_SETTINGS_MODULE environment variable?</p>
  
  <p>If I run the following code:</p>
  
  <pre><code>&gt;&gt;&gt; import django.template
  &gt;&gt;&gt; from django.template import Template, Context
  &gt;&gt;&gt; t = Template('My name is {{ my_name }}.')
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
  </code></pre>