The Google APIs python client has special support for the Django and in the examples given by Google (https://developers.google.com/api-client-library/python/guide/django), the class oauth2client.django_orm.Storage is used to store and retrieve Credentials objects.
However, I find lots of examples (https://github.com/jgmize/django-google-drive/tree/master/gdrive/gdoauth2, https://github.com/praekelt/django-google-credentials/tree/master/google_credentials ,etc) put the Credentials in a CredentialsField field of the user's profile,and it is saved into the database.
What are the advantages / disadvantages of the two methods ? Are there preferences ?
Thanx.
To implementsign in with google feature you can use django-allauth https://django-allauth.readthedocs.io/en/latest/
it provides easy to integrate set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://django-allauth.readthedocs.io/en/latest/providers.html#google
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With