Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Any resources for social login (Twitter, Facebook, etc) with peewee? There are too many SQLAlchemy examples....

I currently have a project that is incorporated with an email login, but I find it more meaningful and pleasant to give the user the ability to login with the social network accounts their familiar with. Are there tutorials or resources that anyone knows of or has implemented themselves? If so, please, do share. I have searched countless of times, but I've only stumbled upon tutorials highlighting the use of SQLAlchemy, unfortunately I'm not sure how to translate those instructions using peewee.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Since both SQLAlchemy and Peewee are both Python ORMs you should be able to convert tutorials from SQLAlchemy to Peewee. That's not to say that it is a necessarily simple thing to achieve, but certainly doable. Doing a quick Google search I couldn't find any examples for Flask-Social with Peewee, so perhaps yours will be the first!

Start on a small project doing it with both ORMs and then work your way up. Here is one example of similar projects done using different ORMs in Python. That may give you some direction.

Happy coding,
Ken

Thank you for the advice Ken. I'll get started on that as soon as possible! Thank you for the resources as well!

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Guled;

If you are doing this in Flask, have you looked at Flask-Socal?

Ken

I have looked at Flask-Social, but what deterred me from following the tutorial was the fact that this module was required:

from flask.ext.social.datastore import SQLAlchemyConnectionDatastore

Also their use of functions like:

SQLAlchemyUserDatastore(db, User, Role)

Made it feel like that plugin was only compatible with SQLAlchemy. I wasn't quite sure how to implement their tutorial using Peewee.