Last active
August 29, 2015 14:05
-
-
Save fisherds/e657dfe0b2b9c51b0823 to your computer and use it in GitHub Desktop.
Creating an instance of the Jinja Environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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