title: HTML templating using Jinja2 - Lost
body: <p>I am trying to create a html template in python using Jinja2. I have a templates folder with my 'template.html' but I don't know how to deal with environments or package loaders.</p>
  
  <p>I installed Jinja2 using easy_python and ran the following script.</p>
  
  <pre><code>from jinja2 import Environment, PackageLoader
  env = Environment(loader=PackageLoader('yourapplication', 'templates'))
  template = env.get_template('mytemplate.html')
  print template.render()
  </code></pre>
  
  <p>I get the following error because I don't know how to define a package/module. Please help me I just want to create a simple template. </p>
  
  <pre><code>  File "log_manipulationLL.py", line 291, in &lt;module&gt;
  env = Environment(loader=PackageLoader('yourapplication', 'templates'))
   File "/usr/local/lib/python2.7/dist-packages/Jinja2-2.6-py2.7.egg/jinja2/loaders.py",    line 216, in __init__
  provider = get_provider(package_name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 213, in get_provider
  __import__(moduleOrReq)
  ImportError: No module named yourapplication
  </code></pre>