From f95c605e296dc8f4987ad977f157292809a77ccc Mon Sep 17 00:00:00 2001 From: Bogdan Radko Date: Wed, 9 Mar 2016 01:00:34 +0100 Subject: [PATCH] Update README --- README.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index 07da6e0..7327090 100644 --- a/README.rst +++ b/README.rst @@ -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 -------- @@ -71,4 +58,17 @@ Or per model: from django_gcs import GoogleCloudStorage class FileModel(models.Model): - file = models.ImageField(storage=GoogleCloudStorage(bucket='some-bucket')) \ No newline at end of file + 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 \ No newline at end of file