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 6249293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:12:37+00:00 2026-05-24T13:12:37+00:00

I am using python and Google app engine. I would like to use the

  • 0

I am using python and Google app engine. I would like to use the task queue. As part of the task queue handler I check if the current user is an admin (using the Users service). This test always fails. Is there a way to cause this test to pass?

update: To avoid further confusion, I am trying to find if the user that triggered the task was an admin or not (this is just a simple example). I understand that the task is being run from the server and all the users cookies are long gone. So the answer I was hopping for was a way to transfer the session to the task

import logging
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import taskqueue

class MyRequesHandler(webapp.RequestHandler):
    def get(self):
        taskqueue.add(url="/task/")

class MyTaskHandler(webapp.RequestHandler):
    def post(self):
        if users.is_current_user_admin():
            logging.debug("admin")
        else:
            logging.debug("not admin")


def main():
    logging.getLogger().setLevel(logging.DEBUG)
    application = webapp.WSGIApplication([
            ('/', MyRequesHandler),
            ('/task/', MyTaskHandler)
        ],
        debug=True)
    run_wsgi_app(application)
  • 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-24T13:12:38+00:00Added an answer on May 24, 2026 at 1:12 pm

    The Users API reflects the details of the logged in user for the current request, and obviously in the case of a task queue task, there is no user, since it’s initiated by the task queue system. You’ll need to perform this check before you enqueue the task, and pass the result as a flag to the task, instead.

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

Sidebar

Related Questions

I am interested in making a Google Talk client using Python and would like
I'm using Google App Engine and python for a web service. Some of the
Using the Google App Engine to develop in python yesterday it stopped running the
How can I read the colors of an image with python using google app
Using Python's Imaging Library I want to create a PNG file. I would like
I would like to provide my Python GAE website in the user's own language,
I'm currently building a Python webapp on the Google App Engine and I want
I am developing a Java application using Google App Engine that depends on a
in a form, I submit data to a python webapp handler (all Google App
Using Python, how would I go about reading in (be from a string, file

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.