Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
bodja committed Mar 9, 2016
1 parent 5cad01c commit f95c605
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ Update ``settings.py``
'http': get_http_credentials
}
If you decided to use google oauth2 credentials file like as you see above take a look on example below:

.. code:: python
import pickle
import httplib2
def get_http_credentials():
with open('google/oauth2/credentials/file', 'r') as f:
credentials = pickle.load(f)
http_credentials = credentials.authorize(httplib2.Http())
return http_credentials
Settings
--------

Expand Down Expand Up @@ -71,4 +58,17 @@ Or per model:
from django_gcs import GoogleCloudStorage
class FileModel(models.Model):
file = models.ImageField(storage=GoogleCloudStorage(bucket='some-bucket'))
file = models.ImageField(storage=GoogleCloudStorage(bucket='some-bucket'))
Example how to generate HTTP object to make request.

.. code:: python
import pickle
import httplib2
def get_http_credentials():
with open('google/oauth2/credentials/file', 'r') as f:
credentials = pickle.load(f)
http_credentials = credentials.authorize(httplib2.Http())
return http_credentials

0 comments on commit f95c605

Please sign in to comment.