I am following a google app engine exercise and having trouble rendering a jinja template properly.
The following code does what I expect it to do (it allows me to render a template with values from my GQL query:
def get(self):
blogpost = db.GqlQuery("SELECT * FROM BlogPosts ORDER BY created ASC")
self.render('blog.html',blogpost=blogpost)
That code renders my blog.html template with when I use tags like {{post.subject}}
This code does not let me render a template:
def get(self):
path = self.request.path[1:]
post = db.GqlQuery("SELECT * FROM BlogPosts WHERE ID = " + str(path))
self.render('permalink.html',post=post)
i believe you can’t query by ID this way. The id is part of the entity key so:
this should give you the desired result.