OPEN ARCHIVE · 2012

Using Decorators in Google App Engine

· By · 1 min read

If you can use python decorator in your app engine project, there is tiny and smart example below which you can use it:
The print will be user email

def uzman(func):
    def check_auth(*args, **kwargs):
        user=users.get_current_user()
        print user
        return func(*args, **kwargs)
    return check_auth

class TestModule(webapp.RequestHandler):
    @uzman
    def get(self): 
          pass