mirror of https://github.com/zulip/zulip.git
Move twitter API credentials to local_settings.py.
(imported from commit 6b95db113b91816fbc5e91db4b1be90d3df8e028)
This commit is contained in:
parent
fff4244b54
commit
8a5fffa7cf
|
@ -82,26 +82,11 @@ def fetch_tweet_data(tweet_id):
|
|||
import testing_mocks
|
||||
res = testing_mocks.twitter(tweet_id)
|
||||
else:
|
||||
if settings.STAGING_DEPLOYED or settings.TESTING_DEPLOYED:
|
||||
# Application: "Humbug HQ"
|
||||
api = twitter.Api(consumer_key = 'xxxxxxxxxxxxxxxxxxxxxx',
|
||||
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_key = 'xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
||||
elif settings.DEPLOYED:
|
||||
# This is the real set of API credentials used by our real server,
|
||||
# and we probably shouldn't test with it just so we don't waste its requests
|
||||
# Application: "Humbug HQ - Production"
|
||||
api = twitter.Api(consumer_key = 'xxxxxxxxxxxxxxxxxxxxx',
|
||||
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_key = 'xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
||||
else:
|
||||
# Application: "Humbug HQ Test"
|
||||
api = twitter.Api(consumer_key = 'xxxxxxxxxxxxxxxxxxxxxx',
|
||||
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_key = 'xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||
access_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
||||
api = twitter.Api(consumer_key = settings.TWITTER_CONSUMER_KEY,
|
||||
consumer_secret = settings.TWITTER_CONSUMER_SECRET,
|
||||
access_token_key = settings.TWITTER_ACCESS_TOKEN_KEY,
|
||||
access_token_secret = settings.TWITTER_ACCESS_TOKEN_SECRET)
|
||||
|
||||
try:
|
||||
# Sometimes Twitter hangs on responses. Timing out here
|
||||
# will cause the Tweet to go through as-is with no inline
|
||||
|
|
|
@ -59,3 +59,25 @@ else:
|
|||
S3_AVATAR_BUCKET="humbug-user-avatars-test"
|
||||
|
||||
MIXPANEL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
# Twitter API credentials
|
||||
if STAGING_DEPLOYED or TESTING_DEPLOYED:
|
||||
# Application: "Humbug HQ"
|
||||
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
elif DEPLOYED:
|
||||
# This is the real set of API credentials used by our real server,
|
||||
# and we probably shouldn't test with it just so we don't waste its requests
|
||||
# Application: "Humbug HQ - Production"
|
||||
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
else:
|
||||
# Application: "Humbug HQ Test"
|
||||
TWITTER_CONSUMER_KEY = "xxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_CONSUMER_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_KEY = "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
TWITTER_ACCESS_TOKEN_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
|
Loading…
Reference in New Issue