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'm using Google App Engine and Django templates. I have a table that I
I have a simple Google App Engine app, that I wrote using ordinary strings.
As the title suggests, I'm using Google App Engine and Django. I have quite
I have a Google App Engine app - http://mylovelyapp.appspot.com/ It has a page -
So I have this code in a google app engine template: <select name='voter'> {%
I have an app that would benefit from google-style autocompletion while filling in an
Have just started using Google Chrome , and noticed in parts of our site,
I have a Google Map that suddenly stopped working for no apparent reason (I
Outline OK, I have Google'd this and already expecting a big fat NO!! But
I have scanned 'the Google' and have not found the definitive answer on whether

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.