From: Seth Woodworth Date: Wed, 23 Jan 2013 03:44:35 +0000 (-0500) Subject: customize google drive auth module for new security layout X-Git-Tag: release-20150131~551^2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2a6adca44f5a8a946fee8d79812406c9871ae944;p=oweals%2Fkarmaworld.git customize google drive auth module for new security layout --- diff --git a/karmaworld/apps/notes/admin.py b/karmaworld/apps/notes/admin.py index ef5d459..650e9cb 100644 --- a/karmaworld/apps/notes/admin.py +++ b/karmaworld/apps/notes/admin.py @@ -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) diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index 61407db..b4d3314 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -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():