2014-08-08 16:08:46 +04:00
|
|
|
"""This is the standard development settings file.
|
|
|
|
|
|
|
|
If you need to overload settings, please do so in a local_settings.py file (it
|
|
|
|
won't be tracked in git).
|
|
|
|
|
|
|
|
"""
|
2014-10-01 15:44:44 +04:00
|
|
|
import os
|
2016-11-02 18:56:10 +03:00
|
|
|
from urlparse import urlparse
|
2014-10-01 15:44:44 +04:00
|
|
|
|
2015-12-16 11:46:10 +03:00
|
|
|
from olympia.lib.settings_base import * # noqa
|
2014-08-08 16:08:46 +04:00
|
|
|
|
2016-03-15 17:22:16 +03:00
|
|
|
WSGI_APPLICATION = 'olympia.wsgi.application'
|
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
DEBUG = True
|
2015-03-16 12:50:22 +03:00
|
|
|
DEBUG_PROPAGATE_EXCEPTIONS = False
|
2014-08-08 16:08:46 +04:00
|
|
|
|
|
|
|
# These apps are great during development.
|
|
|
|
INSTALLED_APPS += (
|
2015-12-16 11:46:10 +03:00
|
|
|
'olympia.landfill',
|
2014-08-08 16:08:46 +04:00
|
|
|
)
|
|
|
|
|
2014-09-02 20:03:20 +04:00
|
|
|
# Using locmem deadlocks in certain scenarios. This should all be fixed,
|
|
|
|
# hopefully, in Django1.7. At that point, we may try again, and remove this to
|
|
|
|
# not require memcache installation for newcomers.
|
|
|
|
# A failing scenario is:
|
|
|
|
# 1/ log in
|
|
|
|
# 2/ click on "Submit a new addon"
|
|
|
|
# 3/ click on "I accept this Agreement" => request never ends
|
|
|
|
#
|
|
|
|
# If this is changed back to locmem, make sure to use it from "caching" (by
|
|
|
|
# default in Django for locmem, a timeout of "0" means "don't cache it", while
|
|
|
|
# on other backends it means "cache forever"):
|
|
|
|
# 'BACKEND': 'caching.backends.locmem.LocMemCache'
|
2014-08-08 16:08:46 +04:00
|
|
|
CACHES = {
|
|
|
|
'default': {
|
2014-09-02 20:03:20 +04:00
|
|
|
'BACKEND': 'caching.backends.memcached.MemcachedCache',
|
2014-10-01 15:44:44 +04:00
|
|
|
'LOCATION': os.environ.get('MEMCACHE_LOCATION', 'localhost:11211'),
|
2014-08-08 16:08:46 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-06 14:00:00 +03:00
|
|
|
# For local development, we don't need syslog and mozlog loggers.
|
|
|
|
USE_SYSLOG = False
|
|
|
|
USE_MOZLOG = False
|
2014-08-08 16:08:46 +04:00
|
|
|
|
|
|
|
# If you're not running on SSL you'll want this to be False.
|
|
|
|
SESSION_COOKIE_SECURE = False
|
|
|
|
SESSION_COOKIE_DOMAIN = None
|
|
|
|
|
2017-10-16 12:16:41 +03:00
|
|
|
CELERY_TASK_ALWAYS_EAGER = False
|
2014-08-08 16:08:46 +04:00
|
|
|
|
|
|
|
# If you want to allow self-reviews for add-ons/apps, then enable this.
|
|
|
|
# In production we do not want to allow this.
|
|
|
|
ALLOW_SELF_REVIEWS = True
|
|
|
|
|
|
|
|
# Assuming you did `npm install` (and not `-g`) like you were supposed to, this
|
|
|
|
# will be the path to the `stylus` and `lessc` executables.
|
2015-09-29 11:38:50 +03:00
|
|
|
STYLUS_BIN = os.getenv('STYLUS_BIN', path('node_modules/stylus/bin/stylus'))
|
|
|
|
LESS_BIN = os.getenv('LESS_BIN', path('node_modules/less/bin/lessc'))
|
2015-11-20 11:08:15 +03:00
|
|
|
CLEANCSS_BIN = os.getenv(
|
|
|
|
'CLEANCSS_BIN',
|
2017-01-30 16:18:06 +03:00
|
|
|
path('node_modules/clean-css-cli/bin/cleancss'))
|
2015-11-20 11:08:15 +03:00
|
|
|
UGLIFY_BIN = os.getenv(
|
|
|
|
'UGLIFY_BIN',
|
|
|
|
path('node_modules/uglify-js/bin/uglifyjs'))
|
2016-02-24 12:53:26 +03:00
|
|
|
ADDONS_LINTER_BIN = os.getenv(
|
|
|
|
'ADDONS_LINTER_BIN',
|
|
|
|
path('node_modules/addons-linter/bin/addons-linter'))
|
2014-08-08 16:08:46 +04:00
|
|
|
|
|
|
|
# Locally we typically don't run more than 1 elasticsearch node. So we set
|
|
|
|
# replicas to zero.
|
|
|
|
ES_DEFAULT_NUM_REPLICAS = 0
|
|
|
|
|
2015-10-30 20:21:04 +03:00
|
|
|
SITE_URL = os.environ.get('OLYMPIA_SITE_URL') or 'http://localhost:8000'
|
2016-11-02 18:56:10 +03:00
|
|
|
SERVICES_DOMAIN = urlparse(SITE_URL).netloc
|
2016-07-20 12:05:29 +03:00
|
|
|
SERVICES_URL = SITE_URL
|
2014-08-08 16:08:46 +04:00
|
|
|
|
2016-11-02 18:56:10 +03:00
|
|
|
ALLOWED_HOSTS = ALLOWED_HOSTS + [SERVICES_DOMAIN]
|
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
ADDON_COLLECTOR_ID = 1
|
|
|
|
|
2015-03-07 18:22:21 +03:00
|
|
|
# Default AMO user id to use for tasks (from users.json fixture in zadmin).
|
|
|
|
TASK_USER_ID = 10968
|
|
|
|
|
2015-03-07 21:23:18 +03:00
|
|
|
# Set to True if we're allowed to use X-SENDFILE.
|
|
|
|
XSENDFILE = False
|
2014-08-08 16:08:46 +04:00
|
|
|
|
2015-09-22 14:29:46 +03:00
|
|
|
|
2015-10-08 22:45:44 +03:00
|
|
|
AES_KEYS = {
|
2015-12-28 22:08:27 +03:00
|
|
|
'api_key:secret': os.path.join(
|
|
|
|
ROOT, 'src', 'olympia', 'api', 'tests', 'assets', 'test-api-key.txt'),
|
2015-10-08 22:45:44 +03:00
|
|
|
}
|
|
|
|
|
2015-11-10 02:19:15 +03:00
|
|
|
# FxA config for local development only.
|
|
|
|
FXA_CONFIG = {
|
2016-04-21 23:31:31 +03:00
|
|
|
'default': {
|
|
|
|
'client_id': 'cd5a21fafacc4744',
|
|
|
|
'client_secret':
|
|
|
|
'4db6f78940c6653d5b0d2adced8caf6c6fd8fd4f2a3a448da927a54daba7d401',
|
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
2016-09-14 08:18:19 +03:00
|
|
|
'redirect_url': 'http://olympia.dev/api/v3/accounts/authenticate/',
|
2016-04-21 23:31:31 +03:00
|
|
|
'scope': 'profile',
|
|
|
|
},
|
|
|
|
'internal': {
|
|
|
|
'client_id': '0f95f6474c24c1dc',
|
|
|
|
'client_secret':
|
|
|
|
'ca45e503a1b4ec9e2a3d4855d79849e098da18b7dfe42b6bc76dfed420fc1d38',
|
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
2016-04-27 17:54:15 +03:00
|
|
|
'redirect_url': 'http://localhost:3000/fxa-authenticate',
|
2016-04-21 23:31:31 +03:00
|
|
|
'scope': 'profile',
|
2017-02-23 21:19:27 +03:00
|
|
|
'skip_register_redirect': True,
|
2016-04-21 23:31:31 +03:00
|
|
|
},
|
2017-02-17 19:08:30 +03:00
|
|
|
'local': {
|
|
|
|
'client_id': '1778aef72d1adfb3',
|
|
|
|
'client_secret':
|
|
|
|
'3feebe3c009c1a0acdedd009f3530eae2b88859f430fa8bb951ea41f2f859b18',
|
|
|
|
'content_host': 'https://stable.dev.lcip.org',
|
|
|
|
'oauth_host': 'https://oauth-stable.dev.lcip.org/v1',
|
|
|
|
'profile_host': 'https://stable.dev.lcip.org/profile/v1',
|
|
|
|
'redirect_url': 'http://localhost:3000/api/v3/accounts/authenticate/',
|
|
|
|
'scope': 'profile',
|
|
|
|
},
|
2016-04-20 01:24:45 +03:00
|
|
|
}
|
2016-09-14 08:18:07 +03:00
|
|
|
FXA_CONFIG['amo'] = FXA_CONFIG['internal']
|
2016-09-21 01:08:09 +03:00
|
|
|
ALLOWED_FXA_CONFIGS = ['default', 'amo', 'local']
|
2015-10-08 22:45:44 +03:00
|
|
|
|
2016-01-11 20:30:32 +03:00
|
|
|
# CSP report endpoint which returns a 204 from addons-nginx in local dev.
|
|
|
|
CSP_REPORT_URI = '/csp-report'
|
|
|
|
|
2016-01-12 00:00:25 +03:00
|
|
|
# Allow GA over http + www subdomain in local development.
|
|
|
|
HTTP_GA_SRC = 'http://www.google-analytics.com'
|
2016-01-14 16:45:35 +03:00
|
|
|
CSP_FRAME_SRC += ('https://www.sandbox.paypal.com',)
|
2016-01-12 00:00:25 +03:00
|
|
|
CSP_IMG_SRC += (HTTP_GA_SRC,)
|
2016-09-09 17:01:25 +03:00
|
|
|
CSP_SCRIPT_SRC += (HTTP_GA_SRC, "'self'")
|
2016-01-12 00:00:25 +03:00
|
|
|
|
2016-08-10 23:04:57 +03:00
|
|
|
# Auth token required to authorize inbound email.
|
2016-10-04 13:53:58 +03:00
|
|
|
INBOUND_EMAIL_SECRET_KEY = 'totally-unsecure-secret-string'
|
|
|
|
# Validation key we need to send in POST response.
|
|
|
|
INBOUND_EMAIL_VALIDATION_KEY = 'totally-unsecure-validation-string'
|
2016-08-10 23:04:57 +03:00
|
|
|
|
2016-12-23 03:29:17 +03:00
|
|
|
# For the Github webhook API.
|
|
|
|
GITHUB_API_USER = ''
|
|
|
|
GITHUB_API_TOKEN = ''
|
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
# If you have settings you want to overload, put them in a local_settings.py.
|
|
|
|
try:
|
|
|
|
from local_settings import * # noqa
|
|
|
|
except ImportError:
|
|
|
|
pass
|