[Fixed]-How do i verify user in database in google appengine app ( can anyone recommend the best way to do user authentication for google appengine app)?

1👍

You seem to be asking so many questions in one.

To get user by email, simply do this:

users = Users.query(Users.email=='query_email').fetch(1)
#note fetch() always returns a list
if users:
    user_exists = True
else:
    user_exists = False

Please note, you may need to update your datastore index to support that query. The easiest way to do it is to first run the code in your local development server, and the index will be automatically updated for you.

To answer your second questions, for user authentication I would recommend Django’s in-built User Authentication. Please note that you can always run vanilla django on appengine with a Flexible VM using CloudSQL instead of the Datastore.

Alternatively, you could use the Appengine Users API, though your users would need to have Google Accounts.

Leave a comment