From fa9aa1801a314320449363af582c4cbde17a7cba Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Wed, 30 Nov 2016 14:48:22 -0800 Subject: [PATCH] mostly replace please twitter and facebook settings --- experimental/matcher.py | 8 +++++++- settings/localvm.py | 3 ++- settings/prod.py | 1 + vagrant/templates/please.py.j2 | 19 +++++++------------ 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/experimental/matcher.py b/experimental/matcher.py index 779acefb..fe7dcb41 100755 --- a/experimental/matcher.py +++ b/experimental/matcher.py @@ -6,6 +6,12 @@ import fileinput import requests +try: + from django.conf import settings + GOOGLE_BOOKS_API_KEY = settings.GOOGLE_BOOKS_API_KEY +except: + GOOGLE_BOOKS_API_KEY = os.environ.get('GOOGLE_BOOKS_API_KEY', '') + def match(): for line in fileinput.input(): j = json.loads(line) @@ -18,7 +24,7 @@ def google_search(title, authors, no_matches): # the title and author are intentionally not fielded params = { 'q': title, - 'key': 'AIzaSyBE36z7o6NUafIWcLEB8yk2I47-8_5y1_0' + 'key': GOOGLE_BOOKS_API_KEY } for author in authors: params['q'] += ' ' + norm_author(author) diff --git a/settings/localvm.py b/settings/localvm.py index 558e2df0..3b01de9b 100644 --- a/settings/localvm.py +++ b/settings/localvm.py @@ -48,7 +48,8 @@ SOCIAL_AUTH_TWITTER_SECRET = 'YSKHn8Du6EWqpcWZ6sp5tqDPvcOBXK0WJWVGWyB0' # facebook auth (for localvm) # https://developers.facebook.com/apps/401501793375379/settings/ SOCIAL_AUTH_FACEBOOK_KEY = '401501793375379' -SOCIAL_AUTH_FACEBOOK_SECRET = '7b63412aa28f408e6349eb0eceb1fcc3' +# reset 2016.11.30 +# SOCIAL_AUTH_FACEBOOK_SECRET = '7b63412aa28f408e6349eb0eceb1fcc3' # get these (as oauth2 client ID and Secret from # https://console.developers.google.com/project/grand-analyzer-95823/apiui/credential?clientType&authuser=0# diff --git a/settings/prod.py b/settings/prod.py index 7f9bbddb..7db4dac9 100644 --- a/settings/prod.py +++ b/settings/prod.py @@ -59,6 +59,7 @@ SOCIAL_AUTH_TWITTER_KEY = 'sd9StEg1N1qB8gGb2GRX4A' SOCIAL_AUTH_TWITTER_SECRET = 'YSKHn8Du6EWqpcWZ6sp5tqDPvcOBXK0WJWVGWyB0' # facebook auth +# https://developers.facebook.com/apps/211951285561911/dashboard/ SOCIAL_AUTH_FACEBOOK_KEY = '211951285561911' SOCIAL_AUTH_FACEBOOK_SECRET = '42efef7e540b80479dbbb69490cd902a' diff --git a/vagrant/templates/please.py.j2 b/vagrant/templates/please.py.j2 index 70dfdfc9..abf2b70c 100644 --- a/vagrant/templates/please.py.j2 +++ b/vagrant/templates/please.py.j2 @@ -40,22 +40,21 @@ EMAIL_HOST_PASSWORD = '7k3sWyzHpI' EMAIL_PORT = 587 DEFAULT_FROM_EMAIL = 'accounts@gluejar.com' -# googlebooks -# GOOGLE_BOOKS_API_KEY = 'AIzaSyBE36z7o6NUafIWcLEB8yk2I47-8_5y1_0' -# GOOGLE_BOOKS_API_KEY = os.environ.get('GOOGLE_BOOKS_API_KEY', '') - # all the SECRET_KEYS {% for key in SECRET_KEYS %} {{key}} = os.environ.get('{{key}}', '') {% endfor %} # twitter auth -SOCIAL_AUTH_TWITTER_KEY = 'sd9StEg1N1qB8gGb2GRX4A' -SOCIAL_AUTH_TWITTER_SECRET = 'YSKHn8Du6EWqpcWZ6sp5tqDPvcOBXK0WJWVGWyB0' +# source? +# SOCIAL_AUTH_TWITTER_KEY = 'sd9StEg1N1qB8gGb2GRX4A' +# SOCIAL_AUTH_TWITTER_SECRET = 'YSKHn8Du6EWqpcWZ6sp5tqDPvcOBXK0WJWVGWyB0' # facebook auth -SOCIAL_AUTH_FACEBOOK_KEY = '242881179080779' -SOCIAL_AUTH_FACEBOOK_SECRET = '5eae483a0e92113d884c427b578ef23a' +# source? +# SOCIAL_AUTH_FACEBOOK_KEY = '242881179080779' +# SOCIAL_AUTH_FACEBOOK_SECRET = '5eae483a0e92113d884c427b578ef23a' + # get these (as oauth2 client ID and Secret from # https://console.developers.google.com/project/569579163337/apiui/credential?authuser=1 @@ -66,10 +65,6 @@ SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'zueklvlUNGgkxuAWTl-93q1z' GOODREADS_API_KEY = "vfqIO6QAhBVvlxt6hAzZJg" GOODREADS_API_SECRET = "57tq4MpyJ15Hgm2ToZQQFWJ7vraZzOAqHLckWRXQ" -# Freebase credentials -FREEBASE_USERNAME = '' -FREEBASE_PASSWORD = '' - # send celery log to Python logging CELERYD_HIJACK_ROOT_LOGGER = False