adding documentation on authenticating a karmaworld instance against google drive
authorSeth Woodworth <seth@sethish.com>
Wed, 23 Jan 2013 03:43:53 +0000 (22:43 -0500)
committerSeth Woodworth <seth@sethish.com>
Wed, 23 Jan 2013 03:43:53 +0000 (22:43 -0500)
docs/source/gdrive.rst [new file with mode: 0644]

diff --git a/docs/source/gdrive.rst b/docs/source/gdrive.rst
new file mode 100644 (file)
index 0000000..12ccfa4
--- /dev/null
@@ -0,0 +1,33 @@
+Google Drive Authentication
+===========================
+
+Authorizing a new installation of Karmaworld with Google Drive is a convoluted 
+process.
+But it happens infrequently enough that we haven't simplified the process.
+This should probably happen in the future, 
+but in the meantime we can document the process.
+
+Start a django interactive shell
+Import the `karmaworld.apps.notes.gdrive` module.
+build a flow object called `flow`
+open a private browsing instance in a browser
+Log into the google drive account of the GOOGLE_USER set in `karmaworld.secrets.drive`
+get the authorization url
+    flow.step1_authorize_url()
+
+go to that url in your browser
+it will redirecto you to a url in the format of:
+ ...?code=EXCHANGE_CODE
+take the EXCHANGE_CODE and feed it as a string to 
+    credentials = flow.step2_exchange('EXCHANGE_CODE')
+This gives you a credentials object, keep this value
+Create an instance of DriveAuth()
+    from karmaworld.apps.notes.models import DriveAuth
+    auth = DriveAuth()
+and feed the credentials object to it with store()
+    auth.store(credentials)
+This will save the DriveAuth()
+
+You are now authenticated!
+
+