Skip to content

Instantly share code, notes, and snippets.

@fisherds
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save fisherds/e657dfe0b2b9c51b0823 to your computer and use it in GitHub Desktop.

Select an option

Save fisherds/e657dfe0b2b9c51b0823 to your computer and use it in GitHub Desktop.
Creating an instance of the Jinja Environment
import os
import jinja2
import webapp2
# Jinja Environment instance necessary to use Jinja templates.
jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=True)
class MainHandler(webapp2.RequestHandler):
def get(self):
template = jinja_env.get_template("templates/moviequotes.html")
self.response.out.write(template.render({}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment