oauth2client.contrib.django_util.storage module

Contains a storage module that stores credentials using the Django ORM.

class oauth2client.contrib.django_util.storage.DjangoORMStorage(model_class, key_name, key_value, property_name)[source]

Bases: oauth2client.client.Storage

Store and retrieve a single credential to and from the Django datastore.

This Storage helper presumes the Credentials have been stored as a CredentialsField on a db model class.

locked_delete()[source]

Delete Credentials from the datastore.

locked_get()[source]

Retrieve stored credential from the Django ORM.

Returns:
oauth2client.Credentials retrieved from the Django ORM, associated
with the model, key_value->``key_name`` pair used to query for the model, and property_name identifying the CredentialsProperty field, all of which are defined in the constructor for this Storage object.
locked_put(credentials)[source]

Write a Credentials to the Django datastore.

Parameters:credentials – Credentials, the credentials to store.