Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3352760
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:04:09+00:00 2026-05-18T02:04:09+00:00

I have a Google App Engine site, with multiple pages that are rendered using

  • 0

I have a Google App Engine site, with multiple pages that are rendered using templates. I’d like to have a hello, user!-type greeting on the header of every page. I can call users.get_current_user().nickname()(or something like) on every handler and add that to the template values dictionary, but I was wondering if there was a cleaner way to do it – perhaps call it directly from the template?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:04:10+00:00Added an answer on May 18, 2026 at 2:04 am

    I don’t know of a built-in way to access that from a template, but I agree with you that I certainly wouldn’t want to have to re-type the code in every handler.

    If all your views are children of one main handler then you can stick the code in that main handler and be done with it, e.g.:

    class BaseHandler(webapp.RequestHandler):
        def __init__(self):
            pass
    
        def render(self, template_filename, template_args):
            nick = users.get_current_user().nickname()
            template_args['nick'] = nick
    
            self.response.out.write(
                template.render(
                    self.template_path(template_filename), template_args))
    

    Source code for a full example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple python web site using Google App Engine. Currently, the
I'm building a site on google app engine and its core code and database
I have developed a dating website built on top of the Google App Engine,
I'm new to python, django and google app engine. All great tools and have
Usually I would use virtualenv and pip for deployment of web applications. With Google
Trying to use federated authentication with AppEngine. I have implemented the authenication part but
I am creating a website with a friend to try and make some money.
What's the best practice for filtering based on a foreign key's property in a
More of an architecture / long-term view question. I'm in the process of putting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.