def _render_template(self, message=None):
    """Render the main page template."""

    # Query the DB for entries:
    notes_query = Note.all()
    notes_query.filter('public =', True)
    notes_query.order('-date')
    notes = notes_query.run()
    template_values = {'notes': notes}

    template = jinja_environment.get_template('templates/index.html')
    self.response.out.write(template.render(template_values))
  def _render_template(self, message=None):
    """Render the user page template."""

    notes_query = Note.all()
    notes_query.order('-date')
    notes_query.filter('userId =', self.userid)
    notes = notes_query.run()
    template_values = {'notes': notes}

    displayName = StorageByKeyName(Credentials, self.userid, 'displayName').get()
    template_values['displayName'] = displayName

    template_values['approved'] = StorageByKeyName(Credentials, self.userid, 'approved').get()

    template = jinja_environment.get_template('templates/contributor.html')
    self.response.out.write(template.render(template_values))