user2592860
user2592860

Reputation: 11

How can I get all Auth Users on Webapp2?

I'm making an administrative tool, and I need to list all my auth users on webapp2. The problem is that the User model of auth models doesn't have the all() method.

So, how can I get all users on webapp2?

Upvotes: 0

Views: 186

Answers (1)

Brent Washburne
Brent Washburne

Reputation: 13138

Edited to show a more complete example:

from webapp2_extras.appengine.auth.models import User
class UserHandler(BaseHandler):
    def get(self):
        users = User.query().fetch()
        self.render_response('templates/users.html', locals())

Inside the template, users.html, you can loop through the users variable.

My BaseHandler includes the method render_response() to render a template.

Upvotes: 1

Related Questions