From fec5102ce60a70c6c1f6ec35db71611a206d27a1 Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 19 Dec 2013 04:05:49 -0500 Subject: [PATCH] fixing the example drive.py, properly importing it, and supporting it on VM upstart --- fabfile.py | 2 +- karmaworld/apps/notes/gdrive.py | 2 +- karmaworld/secret/drive.py.example | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fabfile.py b/fabfile.py index 1e9e164..6d9bd8f 100644 --- a/fabfile.py +++ b/fabfile.py @@ -255,7 +255,7 @@ def check_secrets(): """ secrets_path = env.code_root + '/karmaworld/secret' - secrets_files = ('filepicker.py', 'static_s3.py', 'db_settings.py', 'drive.py', 'client_secrets.json') + secrets_files = ('filepicker.py', 'static_s3.py', 'db_settings.py', 'drive.py', 'client_secrets.json', 'drive.p12') errors = [] for sfile in secrets_files: diff --git a/karmaworld/apps/notes/gdrive.py b/karmaworld/apps/notes/gdrive.py index 531df01..dc9242c 100644 --- a/karmaworld/apps/notes/gdrive.py +++ b/karmaworld/apps/notes/gdrive.py @@ -13,7 +13,7 @@ from apiclient.http import MediaInMemoryUpload from django.core.files.base import ContentFile from oauth2client.client import SignedJwtAssertionCredentials -import secrets.drive as drive +import karmaworld.secret.drive as drive PPT_MIMETYPES = ['application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'] diff --git a/karmaworld/secret/drive.py.example b/karmaworld/secret/drive.py.example index 2d2942e..43c87ec 100644 --- a/karmaworld/secret/drive.py.example +++ b/karmaworld/secret/drive.py.example @@ -7,6 +7,11 @@ that file. DO NOT check drive.py into source control. """ +import os + +from django.conf import settings + + CLIENT_SECRET = os.path.join(settings.DJANGO_ROOT, \ 'path/to/client_secrets.json') -- 2.25.1