Invalid syntax in this simple Python application.
Posted
by
Sergio Boombastic
on Stack Overflow
See other posts from Stack Overflow
or by Sergio Boombastic
Published on 2011-01-15T15:42:50Z
Indexed on
2011/01/15
15:53 UTC
Read the original article
Hit count: 255
Getting an invalid syntax when creating the template_value variable:
class MainPage(webapp.RequestHandler):
def get(self):
blogPosts_query = BlogPost.all().order('-postDate')
blogPosts = blogPosts_query.fetch(10)
if users.get_current_user():
url = users.create_logout_url(self.request.uri)
url_linktext = 'Logout'
else:
url = url = users.create_login_url(self.request.uri)
url_linktext = 'Login'
template_value = (
'blogPosts': blogPosts,
'url': url,
'url_linktext': url_linktext,
)
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
The error fires specifically on the 'blogPosts': blogPosts
line.
What am I doing wrong?
Thanks!
© Stack Overflow or respective owner