mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Initialize default settings if they are missing in the setting module
(imported from commit 97eb19c603436d460ad1832827dc3ec34c36bf31)
This commit is contained in:
@@ -66,9 +66,6 @@ elif DEPLOYED:
|
||||
else:
|
||||
EXTERNAL_HOST = 'localhost:9991'
|
||||
|
||||
# TODO: Make this not required
|
||||
EMBEDLY_KEY=""
|
||||
|
||||
# TODO: Replace these
|
||||
S3_KEY=""
|
||||
S3_SECRET_KEY=""
|
||||
|
||||
@@ -196,6 +196,18 @@ RATE_LIMITING_RULES = [
|
||||
(60, 100), # 100 requests max every minute
|
||||
]
|
||||
|
||||
# For any settings that are not defined in local_settings.py,
|
||||
# we want to initialize them to sane default
|
||||
DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
||||
'TWITTER_CONSUMER_SECRET': '',
|
||||
'TWITTER_ACCESS_TOKEN_KEY': '',
|
||||
'TWITTER_ACCESS_TOKEN_SECRET': '',
|
||||
'EMBEDLY_KEY': ''}
|
||||
|
||||
for setting_name, setting_val in DEFAULT_SETTINGS.iteritems():
|
||||
if not setting_name in vars():
|
||||
vars()[setting_name] = setting_val
|
||||
|
||||
# Static files and minification
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
Reference in New Issue
Block a user