customize google drive auth module for new security layout
authorSeth Woodworth <seth@sethish.com>
Wed, 23 Jan 2013 03:44:35 +0000 (22:44 -0500)
committerSeth Woodworth <seth@sethish.com>
Wed, 23 Jan 2013 03:44:35 +0000 (22:44 -0500)
karmaworld/apps/notes/admin.py
karmaworld/apps/notes/gdrive.py

index ef5d459a8287a0df5008cbcebdbada2f007a6434..650e9cba5c511d3db0b3931763b843df27f725b7 100644 (file)
@@ -5,6 +5,8 @@
 
 from django.contrib import admin
 
-import models
+from karmaworld.apps.notes import models
 
+
+admin.site.register(models.DriveAuth)
 admin.site.register(models.Note)
index 61407db86dd19750fb29d6f25a010d0eb2c60473..b4d3314765c55b15077cfe6148cbdedae5d1b221 100644 (file)
@@ -9,13 +9,19 @@ import os
 import httplib2
 from apiclient.discovery import build
 from apiclient.http import MediaFileUpload
+from django.conf import settings
 from oauth2client.client import flow_from_clientsecrets
 
 from karmaworld.apps.notes.models import DriveAuth, Note
 
-CLIENT_SECRET = './notes/client_secrets.json' # FIXME
+CLIENT_SECRET = os.path.join(settings.DJANGO_ROOT, \
+                    'secret/client_secrets.json')
 #from credentials import GOOGLE_USER # FIXME
-GOOGLE_USER = 'admin@karmanotes.org' # FIXME
+try:
+    from secrets.drive import GOOGLE_USER
+except:
+    GOOGLE_USER = 'admin@karmanotes.org' # FIXME
+
 EXT_TO_MIME = {'.docx': 'application/msword'}
 
 def build_flow():