Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webapp2 auth for standard GAE Python3 #137

Open
fili opened this issue Sep 13, 2018 · 10 comments
Open

Update webapp2 auth for standard GAE Python3 #137

fili opened this issue Sep 13, 2018 · 10 comments

Comments

@fili
Copy link

@fili fili commented Sep 13, 2018

The new standard GAE uses Python3, but does not use:

Memcache

Prefers Firestore over Datastore

Does not support Users API

It is still possible to use webapp2 with the new standard GAE Python3, as an example can be found here: https://bitbucket.org/fili/gae-standard-python37-webapp2-example/src

But the overall integration with GAE services are gone and unlikely to ever come back. It would be best to update the code base to be more independent from GAE old services, or support at least all the different Google Cloud database solutions.

@fili fili changed the title Update webapp2 for Standard GAE Python3 Update webapp2 auth for Standard GAE Python3 Sep 13, 2018
@fili fili changed the title Update webapp2 auth for Standard GAE Python3 Update webapp2 auth for standard GAE Python3 Sep 13, 2018
@theacodes
Copy link
Contributor

@theacodes theacodes commented Sep 13, 2018

Hi, thanks for filing this issue.

Just a heads up - webapp2 is a community-supported project. Someone in the community will need to volunteer to do this. I am happy to review and merge any pull requests.

@AniX
Copy link

@AniX AniX commented Sep 13, 2018

In other words, everything in webapp2_extras/appengine/ can't be used anymore? I believe the same is true for the flexible environment.

Are these modifications supposed to be part of webapp2 3.0.0?

@fili
Copy link
Author

@fili fili commented Sep 14, 2018

Well the difference is that it depends on the database solution you choose. When you create a new project, you get the question if you want the future Firestore as a database solution OR Cloud Datastore, with the latter it may still be possible to create a workable solution with minimal code changes but NDB is not supported in flex.

Once you pick a database solution, you can not use the other solution anymore within the same project. And as Firestore is likely to replace Cloud Datastore - based on the documentation I have read so far it is probably best to either upgrade webapp2 to include the Firestore option OR to make the code database solution independent so any database solution (including for example Cloud SQL) would work using adapters or something alike.

@kits-ragh
Copy link

@kits-ragh kits-ragh commented Feb 25, 2019

I have used webapp2 in my application, Now I am migrating my application in python3, but it gets fail.

Is there any timeline to get the python3 compatible with webapp2 framework.

@fili
Copy link
Author

@fili fili commented Feb 25, 2019

The latest version of webapp2 runs on python3. See also https://bitbucket.org/fili/gae-standard-python37-webapp2-example

@fili
Copy link
Author

@fili fili commented Feb 25, 2019

The problem is that webapp2 has a lot of legacy code for connecting with ndb etc, which is now outdated.

@gerardsimons
Copy link

@gerardsimons gerardsimons commented Dec 8, 2019

What happened to the repo on bitbucket? I would like to run webapp 2 in Python 3.7. Python 2 is sunsetting in less than a month... https://pythonclock.org/

@fili
Copy link
Author

@fili fili commented Dec 8, 2019

Webapp2 already works on python 3. I moved my repo from bitbucket to github here: https://github.com/fili/webapp2-gae-python37

@gerardsimons
Copy link

@gerardsimons gerardsimons commented Dec 11, 2019

Ok, my bad, thanks! 🙏

@montao
Copy link

@montao montao commented Dec 28, 2019

I am going to use Flask instead and created a completely new app in appengine. The User entities which were created with webapp2 User model can be migrated to Firestore in Datastore mode and ndb is supported in the Python3 runtime. The Uniqueness property did not work though, but I can check for uniqueness myself. This was the error in python3 runtime when trying to create a User with the create_user function taking the claims from the Firebase authentication object:

User.create_user(claims.get("email")) File "/srv/auth/models.py", line 409, in create_user ok, existing = cls.unique_model.create_multi(k for k, v in uniques) File "/srv/auth/models.py", line 107, in create_multi created = [model.transaction(lambda: func(e)) for e in entities] File "/srv/auth/models.py", line 107, in <listcomp> created = [model.transaction(lambda: func(e)) for e in entities] AttributeError: module 'google.cloud.ndb.model' has no attribute 'transaction'

I am going to retire my old app (which was created in April 2008). I created a new app with Firestore in Datastore mode, connected it with Firebase authentication, migrated all my User entities (which were created with the webapp2 User model) and can connect a Firebase claims object with a User entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants