2020-12-01 22:18:14 +03:00
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
|
|
|
|
2020-02-24 20:22:24 +03:00
|
|
|
import logging
|
2013-03-07 22:29:38 +04:00
|
|
|
import os
|
|
|
|
|
2020-02-24 20:22:24 +03:00
|
|
|
|
2013-03-07 22:29:38 +04:00
|
|
|
#Hack to get custom tags working django 1.3 + python27.
|
|
|
|
INSTALLED_APPS = (
|
|
|
|
#'nothing',
|
|
|
|
'customtags',
|
|
|
|
)
|
|
|
|
|
|
|
|
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
2019-08-14 21:59:14 +03:00
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [os.path.join(ROOT_DIR, 'templates')],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2020-02-24 20:22:24 +03:00
|
|
|
# By default, send all email to an archive for debugging.
|
|
|
|
# For the live cr-status server, this setting is None.
|
|
|
|
SEND_ALL_EMAIL_TO = 'cr-status-staging-emails+%(user)s+%(domain)s@google.com'
|
|
|
|
|
2020-03-14 00:16:07 +03:00
|
|
|
BOUNCE_ESCALATION_ADDR = 'cr-status-bounces@google.com'
|
|
|
|
|
2021-05-04 21:33:29 +03:00
|
|
|
|
|
|
|
# Display a site maintenance banner on every page. Or, an empty string.
|
|
|
|
BANNER_MESSAGE = ('This site will have a new method of signing in. '
|
|
|
|
'Users will need to sign in again after ')
|
|
|
|
|
|
|
|
# Timestamp used to notify users when the read only mode or other status
|
|
|
|
# described in the banner message takes effect. Or, None. It is
|
|
|
|
# expressed as a tuple of ints: (year, month, day[, hour[, minute[, second]]])
|
|
|
|
# e.g. (2009, 3, 20, 21, 45) represents March 20 2009 9:45PM UTC.
|
2021-05-05 23:16:34 +03:00
|
|
|
BANNER_TIME = (2021, 5, 11, 20, 00) # May 11, noon pacific
|
2021-05-04 21:33:29 +03:00
|
|
|
|
2013-03-07 22:29:38 +04:00
|
|
|
################################################################################
|
|
|
|
|
2020-02-24 20:22:24 +03:00
|
|
|
PROD = False
|
2021-01-21 03:21:14 +03:00
|
|
|
STAGING = False
|
2020-02-24 20:22:24 +03:00
|
|
|
DEBUG = True
|
|
|
|
SEND_EMAIL = False # Just log email
|
2020-12-23 21:46:40 +03:00
|
|
|
DEV_MODE = os.environ['SERVER_SOFTWARE'].startswith('Development')
|
2021-01-16 02:50:36 +03:00
|
|
|
UNIT_TEST_MODE = os.environ['SERVER_SOFTWARE'].startswith('test')
|
|
|
|
|
2021-03-18 20:58:32 +03:00
|
|
|
#setting GOOGLE_CLOUD_PROJECT manually in dev mode
|
|
|
|
if DEV_MODE or UNIT_TEST_MODE:
|
2021-03-19 21:19:57 +03:00
|
|
|
APP_ID = os.environ.get('GOOGLE_CLOUD_PROJECT', 'dev')
|
|
|
|
else:
|
2021-03-18 20:58:32 +03:00
|
|
|
APP_ID = os.environ['GOOGLE_CLOUD_PROJECT']
|
2013-03-07 22:29:38 +04:00
|
|
|
|
2020-03-30 21:12:00 +03:00
|
|
|
SITE_URL = 'http://%s.appspot.com/' % APP_ID
|
2021-01-16 02:50:36 +03:00
|
|
|
CLOUD_TASKS_REGION = 'us-central1'
|
2013-03-07 22:29:38 +04:00
|
|
|
|
2021-03-18 20:58:32 +03:00
|
|
|
if UNIT_TEST_MODE:
|
2020-02-24 20:22:24 +03:00
|
|
|
APP_TITLE = 'Local testing'
|
2020-03-30 21:12:00 +03:00
|
|
|
SITE_URL = 'http://127.0.0.1:8888/'
|
2020-12-23 21:46:40 +03:00
|
|
|
elif DEV_MODE:
|
|
|
|
PROD = False
|
|
|
|
APP_TITLE = 'Chrome Status Dev'
|
|
|
|
SITE_URL = 'http://127.0.0.1:8888/'
|
2020-02-24 20:22:24 +03:00
|
|
|
elif APP_ID == 'cr-status':
|
|
|
|
PROD = True
|
|
|
|
DEBUG = False
|
|
|
|
APP_TITLE = 'Chrome Platform Status'
|
|
|
|
SEND_EMAIL = True
|
|
|
|
SEND_ALL_EMAIL_TO = None # Deliver it to the intended users
|
2020-03-30 21:12:00 +03:00
|
|
|
SITE_URL = 'http://chromestatus.com/'
|
2020-02-24 20:22:24 +03:00
|
|
|
elif APP_ID == 'cr-status-staging':
|
2021-01-21 03:21:14 +03:00
|
|
|
STAGING = True
|
2020-02-24 20:22:24 +03:00
|
|
|
SEND_EMAIL = True
|
|
|
|
APP_TITLE = 'Chrome Platform Status Staging'
|
|
|
|
else:
|
|
|
|
logging.error('Unexpected app ID %r, please configure settings.py.', APP_ID)
|
2013-06-28 19:51:44 +04:00
|
|
|
|
2019-08-14 21:59:14 +03:00
|
|
|
SECRET_KEY = os.environ['DJANGO_SECRET']
|
|
|
|
|
2013-06-28 19:51:44 +04:00
|
|
|
APP_VERSION = os.environ['CURRENT_VERSION_ID'].split('.')[0]
|
2020-12-11 04:04:48 +03:00
|
|
|
|
2013-06-30 04:44:49 +04:00
|
|
|
RSS_FEED_LIMIT = 15
|
2014-03-24 20:23:22 +04:00
|
|
|
|
2020-06-04 00:48:41 +03:00
|
|
|
DEFAULT_CACHE_TIME = 60 # seconds
|
2016-09-01 06:17:19 +03:00
|
|
|
|
2019-08-14 21:59:14 +03:00
|
|
|
USE_I18N = False
|
|
|
|
|
2020-02-24 20:22:24 +03:00
|
|
|
TEMPLATE_DEBUG = DEBUG
|
2016-09-01 06:17:19 +03:00
|
|
|
if DEBUG:
|
|
|
|
TEMPLATE_CACHE_TIME = 0
|
|
|
|
else:
|
|
|
|
TEMPLATE_CACHE_TIME = 600 # seconds
|