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
|
|
|
|
|
2014-08-08 16:08:46 +04:00
|
|
|
from lib.settings_base import * # noqa
|
|
|
|
|
|
|
|
DEBUG = True
|
|
|
|
TEMPLATE_DEBUG = DEBUG
|
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 += (
|
|
|
|
'django_extensions',
|
2014-10-27 13:09:10 +03:00
|
|
|
'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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HAS_SYSLOG = False # syslog is used if HAS_SYSLOG and NOT DEBUG.
|
|
|
|
|
|
|
|
# If you're not running on SSL you'll want this to be False.
|
|
|
|
SESSION_COOKIE_SECURE = False
|
|
|
|
SESSION_COOKIE_DOMAIN = None
|
|
|
|
|
2015-10-20 17:41:52 +03:00
|
|
|
CELERY_ALWAYS_EAGER = False
|
2014-08-08 16:08:46 +04:00
|
|
|
CELERY_ROUTES = {}
|
|
|
|
|
|
|
|
# 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',
|
|
|
|
path('node_modules/clean-css/bin/cleancss'))
|
|
|
|
UGLIFY_BIN = os.getenv(
|
|
|
|
'UGLIFY_BIN',
|
|
|
|
path('node_modules/uglify-js/bin/uglifyjs'))
|
|
|
|
VALIDATOR_BIN = os.getenv(
|
|
|
|
'VALIDATOR_BIN',
|
|
|
|
path('node_modules/addons-validator/bin/addons-validator'))
|
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'
|
2014-08-08 16:08:46 +04:00
|
|
|
SERVICES_DOMAIN = 'localhost:8000'
|
|
|
|
SERVICES_URL = 'http://%s' % SERVICES_DOMAIN
|
|
|
|
|
2015-10-20 17:41:52 +03:00
|
|
|
VALIDATE_ADDONS = True
|
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
|
|
|
# Enable the Django Debug Toolbar for local dev.
|
|
|
|
INSTALLED_APPS += (
|
|
|
|
'debug_toolbar',
|
|
|
|
)
|
|
|
|
DEBUG_TOOLBAR_PATCH_SETTINGS = False # Prevent DDT from patching the settings.
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
|
|
|
|
|
|
|
|
|
2015-10-20 21:00:39 +03:00
|
|
|
def debug_toolbar_disabled(request):
|
|
|
|
"""Callback used by the Django Debug Toolbar to decide when to display."""
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def debug_toolbar_enabled(request):
|
2015-09-22 14:29:46 +03:00
|
|
|
"""Callback used by the Django Debug Toolbar to decide when to display."""
|
|
|
|
# We want to make sure to have the DEBUG value at runtime, not the one we
|
|
|
|
# have in this specific settings file.
|
|
|
|
from django.conf import settings
|
|
|
|
return settings.DEBUG
|
|
|
|
|
|
|
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
2015-10-20 21:00:39 +03:00
|
|
|
"SHOW_TOOLBAR_CALLBACK": "settings.debug_toolbar_disabled",
|
2015-09-22 14:29:46 +03:00
|
|
|
}
|
|
|
|
|
2015-10-08 22:45:44 +03:00
|
|
|
AES_KEYS = {
|
|
|
|
'api_key:secret': os.path.join(ROOT, 'apps', 'api', 'tests', 'assets',
|
|
|
|
'test-api-key.txt'),
|
|
|
|
}
|
|
|
|
|
2015-11-10 02:19:15 +03:00
|
|
|
# FxA config for local development only.
|
|
|
|
FXA_CONFIG = {
|
|
|
|
'client_id': 'cd5a21fafacc4744',
|
|
|
|
'client_secret':
|
|
|
|
'4db6f78940c6653d5b0d2adced8caf6c6fd8fd4f2a3a448da927a54daba7d401',
|
2015-11-25 01:38:27 +03:00
|
|
|
'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',
|
2015-11-27 01:22:31 +03:00
|
|
|
'redirect_url': 'http://olympia.dev/api/v3/accounts/authorize/',
|
2015-11-10 02:19:15 +03:00
|
|
|
'scope': 'profile',
|
|
|
|
}
|
2015-10-08 22:45:44 +03:00
|
|
|
|
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
|