2012-02-17 22:54:10 +04:00
|
|
|
import os
|
|
|
|
|
2012-01-18 21:11:06 +04:00
|
|
|
from lib.settings_base import *
|
2012-03-14 00:55:19 +04:00
|
|
|
from mkt import asset_bundles
|
2012-01-18 21:11:06 +04:00
|
|
|
|
2012-04-10 05:45:03 +04:00
|
|
|
|
2012-02-17 02:22:59 +04:00
|
|
|
# We'll soon need a `settings_test_mkt` to override this.
|
2012-01-18 21:11:06 +04:00
|
|
|
APP_PREVIEW = True
|
2012-02-17 02:22:59 +04:00
|
|
|
|
2012-02-18 03:24:50 +04:00
|
|
|
WAFFLE_TABLE_SUFFIX = 'mkt'
|
2012-05-23 13:02:52 +04:00
|
|
|
LOG_TABLE_SUFFIX = '_mkt'
|
2012-06-26 03:47:19 +04:00
|
|
|
EVENT_TABLE_SUFFIX = '_mkt'
|
2012-02-18 03:24:50 +04:00
|
|
|
|
2012-02-17 02:22:59 +04:00
|
|
|
# So temporary. Allow us to link to new devhub URLs from `Addon.get_dev_url()`.
|
2012-04-13 10:07:04 +04:00
|
|
|
# Also used to determine if we add the /<app>/ to URLs.
|
2012-02-17 02:22:59 +04:00
|
|
|
MARKETPLACE = True
|
|
|
|
|
2012-02-20 04:58:28 +04:00
|
|
|
# 403 view to render for CSRF failures.
|
|
|
|
CSRF_FAILURE_VIEW = 'mkt.site.views.csrf_failure'
|
|
|
|
|
2012-02-24 03:59:18 +04:00
|
|
|
# Set log in/log out URLs for redirects to work.
|
|
|
|
LOGIN_URL = '/login'
|
|
|
|
LOGOUT_URL = '/logout'
|
|
|
|
|
2012-02-28 04:54:07 +04:00
|
|
|
# Let robots tear this place up.
|
|
|
|
ENGAGE_ROBOTS = True
|
|
|
|
|
2012-04-03 05:32:14 +04:00
|
|
|
MKT_REVIEWERS_EMAIL = 'app-reviews@mozilla.org'
|
|
|
|
MKT_SENIOR_EDITORS_EMAIL = 'amo-admin-reviews@mozilla.org'
|
|
|
|
MKT_SUPPORT_EMAIL = 'marketplace-developer-support@mozilla.org'
|
2012-04-22 20:58:34 +04:00
|
|
|
MARKETPLACE_EMAIL = 'amo-marketplace@mozilla.org'
|
|
|
|
ABUSE_EMAIL = 'Mozilla Marketplace <marketplace-abuse@mozilla.org>'
|
|
|
|
NOBODY_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
|
2012-04-17 05:30:04 +04:00
|
|
|
DEFAULT_FROM_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
|
2012-04-03 05:32:14 +04:00
|
|
|
|
2012-05-29 21:36:44 +04:00
|
|
|
# Default app name for our webapp as specified in `manifest.webapp`.
|
|
|
|
WEBAPP_MANIFEST_NAME = 'Mozilla Marketplace'
|
|
|
|
|
2012-01-18 21:11:06 +04:00
|
|
|
ROOT_URLCONF = 'mkt.urls'
|
2012-02-22 08:44:51 +04:00
|
|
|
|
|
|
|
INSTALLED_APPS = list(INSTALLED_APPS)
|
|
|
|
INSTALLED_APPS.remove('api')
|
2012-03-23 06:53:28 +04:00
|
|
|
INSTALLED_APPS.remove('browse')
|
2012-02-22 08:44:51 +04:00
|
|
|
INSTALLED_APPS.remove('compat')
|
|
|
|
INSTALLED_APPS.remove('discovery')
|
|
|
|
INSTALLED_APPS.remove('devhub')
|
2012-03-17 01:25:15 +04:00
|
|
|
INSTALLED_APPS.remove('search')
|
2012-02-22 08:44:51 +04:00
|
|
|
INSTALLED_APPS = tuple(INSTALLED_APPS)
|
|
|
|
|
2012-02-09 15:27:26 +04:00
|
|
|
INSTALLED_APPS += (
|
2012-04-17 22:26:30 +04:00
|
|
|
'devhub', # Put here so helpers.py doesn't get loaded first.
|
2012-05-21 20:01:40 +04:00
|
|
|
'django_appcache',
|
2012-02-09 15:27:26 +04:00
|
|
|
'mkt.site',
|
2012-03-24 05:13:25 +04:00
|
|
|
'mkt.account',
|
2012-03-23 06:53:28 +04:00
|
|
|
'mkt.browse',
|
2012-03-14 03:33:51 +04:00
|
|
|
'mkt.detail',
|
2012-02-17 02:22:59 +04:00
|
|
|
'mkt.developers',
|
2012-04-25 04:15:49 +04:00
|
|
|
'mkt.ecosystem',
|
2012-04-06 02:48:54 +04:00
|
|
|
'mkt.home',
|
2012-03-28 00:31:00 +04:00
|
|
|
'mkt.inapp_pay',
|
2012-06-27 22:52:48 +04:00
|
|
|
'mkt.lookup',
|
2012-03-25 22:59:41 +04:00
|
|
|
'mkt.purchase',
|
2012-05-09 02:07:01 +04:00
|
|
|
'mkt.ratings',
|
2012-06-12 21:29:38 +04:00
|
|
|
'mkt.receipts',
|
2012-04-03 04:58:17 +04:00
|
|
|
'mkt.reviewers',
|
2012-03-15 00:07:14 +04:00
|
|
|
'mkt.search',
|
2012-03-28 12:25:01 +04:00
|
|
|
'mkt.stats',
|
2012-02-09 15:27:26 +04:00
|
|
|
'mkt.submit',
|
2012-03-27 08:16:22 +04:00
|
|
|
'mkt.support',
|
2012-05-18 02:40:38 +04:00
|
|
|
'mkt.themes',
|
2012-04-17 04:09:46 +04:00
|
|
|
'mkt.zadmin',
|
2012-03-23 06:53:28 +04:00
|
|
|
'mkt.webapps',
|
2012-02-09 15:27:26 +04:00
|
|
|
)
|
2012-04-04 21:33:58 +04:00
|
|
|
|
2012-07-10 19:44:29 +04:00
|
|
|
SUPPORTED_NONLOCALES += (
|
|
|
|
'manifest.webapp',
|
|
|
|
'mozmarket.js',
|
|
|
|
'appcache',
|
|
|
|
'csrf',
|
|
|
|
)
|
2012-02-09 15:27:26 +04:00
|
|
|
|
2012-07-10 19:44:29 +04:00
|
|
|
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
|
2012-03-21 01:51:40 +04:00
|
|
|
# TODO: I want to get rid of these eventually but it breaks some junk now.
|
|
|
|
# MIDDLEWARE_CLASSES.remove('mobility.middleware.DetectMobileMiddleware')
|
|
|
|
# MIDDLEWARE_CLASSES.remove('mobility.middleware.XMobileMiddleware')
|
|
|
|
# MIDDLEWARE_CLASSES.remove('cake.middleware.CookieCleaningMiddleware')
|
2012-07-10 19:44:29 +04:00
|
|
|
MIDDLEWARE_CLASSES += (
|
2012-03-21 01:51:40 +04:00
|
|
|
'mkt.site.middleware.VaryOnAJAXMiddleware',
|
2012-04-25 06:22:59 +04:00
|
|
|
|
2012-04-26 10:05:04 +04:00
|
|
|
# TODO: Remove this when we remove `request.can_view_consumer`.
|
2012-04-26 10:30:19 +04:00
|
|
|
'amo.middleware.DefaultConsumerMiddleware',
|
2012-04-25 06:22:59 +04:00
|
|
|
|
2012-04-26 10:05:04 +04:00
|
|
|
# Put this in your settings_local_mkt if you want the walled garden.
|
|
|
|
#'amo.middleware.NoConsumerMiddleware',
|
2012-04-25 06:22:59 +04:00
|
|
|
#'amo.middleware.LoginRequiredMiddleware',
|
2012-07-10 19:44:29 +04:00
|
|
|
)
|
2012-02-18 03:17:57 +04:00
|
|
|
|
2012-04-20 09:56:49 +04:00
|
|
|
TEMPLATE_DIRS += (path('mkt/templates'), path('mkt/zadmin/templates'))
|
2012-02-17 06:48:48 +04:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS)
|
2012-07-10 19:44:29 +04:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS.remove('amo.context_processors.global_settings')
|
2012-02-17 06:48:48 +04:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS += [
|
|
|
|
'mkt.site.context_processors.global_settings',
|
|
|
|
]
|
2012-02-14 12:56:35 +04:00
|
|
|
|
2012-02-15 01:22:46 +04:00
|
|
|
# Tests.
|
|
|
|
NOSE_ARGS = [
|
|
|
|
'--with-fixture-bundling',
|
2012-02-17 22:54:10 +04:00
|
|
|
'--where=%s' % os.path.join(ROOT, 'mkt')
|
2012-02-15 01:22:46 +04:00
|
|
|
]
|
2012-02-14 12:56:35 +04:00
|
|
|
|
2012-02-09 04:58:04 +04:00
|
|
|
NO_ADDONS_MODULES = (
|
|
|
|
'addons.views',
|
|
|
|
'devhub.views.dashboard', # The apps dashboard is a different view.
|
|
|
|
'devhub.views.submit', # Addon submit not ok, app submit a-ok.
|
|
|
|
'browse.views.personas',
|
|
|
|
'browse.views.extensions',
|
|
|
|
'browse.views.language_tools',
|
|
|
|
'browse.views.themes',
|
|
|
|
)
|
|
|
|
|
|
|
|
# Next level, no consumer for you!
|
|
|
|
NO_CONSUMER_MODULES = (
|
|
|
|
'api',
|
|
|
|
'bandwagon.views',
|
|
|
|
'browse.views',
|
|
|
|
'compat.views',
|
|
|
|
'discovery.views',
|
|
|
|
'files.views',
|
|
|
|
'market.views',
|
|
|
|
'piston',
|
2012-02-17 12:34:55 +04:00
|
|
|
'users.views.edit',
|
2012-02-09 04:58:04 +04:00
|
|
|
'users.views.purchases',
|
|
|
|
'users.views.payments',
|
|
|
|
'sharing.views',
|
|
|
|
'tags.views',
|
|
|
|
'versions.views',
|
2012-04-26 06:46:22 +04:00
|
|
|
'mkt.account.views',
|
2012-04-26 23:08:47 +04:00
|
|
|
'mkt.browse.views',
|
2012-04-26 06:46:22 +04:00
|
|
|
'mkt.detail.views',
|
2012-05-23 12:08:04 +04:00
|
|
|
'mkt.ratings.views',
|
2012-04-26 06:46:22 +04:00
|
|
|
'mkt.payments.views',
|
2012-04-26 23:08:47 +04:00
|
|
|
'mkt.stats.views',
|
2012-04-26 06:46:22 +04:00
|
|
|
'mkt.support.views',
|
2012-04-25 06:22:59 +04:00
|
|
|
'mkt.search.views',
|
2012-03-14 03:20:47 +04:00
|
|
|
'mkt.webapps.views',
|
2012-02-09 04:58:04 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
# Specific view modules and methods that we don't want to force login on.
|
|
|
|
NO_LOGIN_REQUIRED_MODULES = (
|
|
|
|
'csp.views.policy',
|
|
|
|
'csp.views.report',
|
2012-02-24 04:43:13 +04:00
|
|
|
'mkt.developers',
|
2012-06-27 22:52:48 +04:00
|
|
|
'mkt.lookup',
|
2012-04-25 06:22:59 +04:00
|
|
|
'mkt.reviewers',
|
2012-02-24 04:43:13 +04:00
|
|
|
'mkt.submit',
|
2012-05-30 02:44:46 +04:00
|
|
|
'django_appcache.views.manifest',
|
2012-02-09 04:58:04 +04:00
|
|
|
'django.views.i18n.javascript_catalog',
|
|
|
|
'django.contrib.auth.views.password_reset',
|
2012-02-24 04:16:47 +04:00
|
|
|
'django.contrib.auth.views.password_reset_done',
|
2012-04-25 06:22:59 +04:00
|
|
|
'jingo.views.direct_to_template',
|
|
|
|
'zadmin.views',
|
|
|
|
'users.browserid_login',
|
2012-04-26 12:15:53 +04:00
|
|
|
'mkt.ecosystem.views',
|
2012-04-25 06:22:59 +04:00
|
|
|
'mkt.site.views',
|
|
|
|
'mkt.zadmin.views',
|
2012-04-28 01:42:49 +04:00
|
|
|
# in-app views have their own login protection.
|
|
|
|
'mkt.inapp_pay.views',
|
2012-05-18 14:41:27 +04:00
|
|
|
'tastypie.resources.wrapper',
|
2012-02-09 04:58:04 +04:00
|
|
|
)
|
2012-02-10 06:23:37 +04:00
|
|
|
|
2012-02-09 15:27:26 +04:00
|
|
|
# Extend the bundles.
|
2012-03-14 00:55:19 +04:00
|
|
|
MINIFY_BUNDLES['css'].update(asset_bundles.CSS)
|
|
|
|
MINIFY_BUNDLES['js'].update(asset_bundles.JS)
|
2012-02-10 06:23:37 +04:00
|
|
|
|
2012-02-23 22:06:05 +04:00
|
|
|
CELERY_ROUTES.update({
|
|
|
|
# Devhub.
|
|
|
|
'mkt.developers.tasks.validator': {'queue': 'devhub'},
|
|
|
|
'mkt.developers.tasks.fetch_manifest': {'queue': 'devhub'},
|
|
|
|
'mkt.developers.tasks.fetch_icon': {'queue': 'devhub'},
|
|
|
|
'mkt.developers.tasks.file_validator': {'queue': 'devhub'},
|
|
|
|
|
|
|
|
# Images.
|
|
|
|
'mkt.developers.tasks.resize_icon': {'queue': 'images'},
|
|
|
|
'mkt.developers.tasks.resize_preview': {'queue': 'images'},
|
|
|
|
})
|
|
|
|
|
2012-02-24 23:45:44 +04:00
|
|
|
# Paths.
|
|
|
|
ADDON_ICONS_DEFAULT_PATH = os.path.join(MEDIA_ROOT, 'img/hub')
|
|
|
|
ADDON_ICONS_DEFAULT_URL = MEDIA_URL + '/img/hub'
|
|
|
|
|
2012-04-27 06:39:31 +04:00
|
|
|
# Directory path to where product images for in-app payments are stored.
|
|
|
|
INAPP_IMAGE_PATH = NETAPP_STORAGE + '/inapp-image'
|
|
|
|
|
2012-05-16 00:19:54 +04:00
|
|
|
# Base URL root to serve in-app product images from.
|
|
|
|
INAPP_IMAGE_URL = INAPP_IMAGE_PATH
|
|
|
|
|
2012-04-27 06:39:31 +04:00
|
|
|
# Tuple of (x, y) pixel sizes that an in-app product image should be
|
|
|
|
# resized to for display on the payment screen.
|
|
|
|
INAPP_IMAGE_SIZE = (150, 150)
|
|
|
|
|
2012-04-03 01:27:08 +04:00
|
|
|
# JWT identifier for this marketplace.
|
|
|
|
# This is used for in-app payments in two ways.
|
|
|
|
# 1. app must send JWTs with aud (the audience) set to this exact value.
|
|
|
|
# 2. apps will receive JWTs with iss (issuer) set to this value.
|
|
|
|
INAPP_MARKET_ID = 'marketplace.mozilla.org'
|
2012-04-11 02:08:04 +04:00
|
|
|
|
|
|
|
# If True, show verbose payment errors to developers.
|
|
|
|
# Consider this insecure.
|
|
|
|
INAPP_VERBOSE_ERRORS = False
|
2012-04-12 00:16:16 +04:00
|
|
|
|
|
|
|
# When False, the developer can toggle HTTPS on/off.
|
|
|
|
# This is useful for development and testing.
|
|
|
|
INAPP_REQUIRE_HTTPS = True
|
2012-04-18 00:57:08 +04:00
|
|
|
|
2012-05-10 22:59:59 +04:00
|
|
|
# Paths to key files for local AES encrypt/decrypt.
|
|
|
|
# Each dict key is a YYYY-MM-DD timestamp that we use to find the latest key.
|
|
|
|
INAPP_KEY_PATHS = {
|
|
|
|
# This is a scratch key for local development.
|
|
|
|
'2012-05-09': os.path.join(ROOT, 'mkt', 'inapp_pay', 'tests', 'resources',
|
|
|
|
'inapp-sample-pay.key')
|
|
|
|
}
|
|
|
|
|
2012-05-02 03:48:08 +04:00
|
|
|
STATSD_RECORD_KEYS = [
|
|
|
|
'window.performance.timing.domComplete',
|
|
|
|
'window.performance.timing.domInteractive',
|
|
|
|
'window.performance.timing.domLoading',
|
2012-05-02 20:35:27 +04:00
|
|
|
'window.performance.timing.fragment.loaded',
|
2012-05-02 03:48:08 +04:00
|
|
|
'window.performance.navigation.redirectCount',
|
|
|
|
'window.performance.navigation.type',
|
|
|
|
]
|
2012-05-14 15:29:51 +04:00
|
|
|
|
|
|
|
PISTON_DISPLAY_ERRORS = False
|
2012-05-21 20:01:40 +04:00
|
|
|
|
|
|
|
# Link to the appcache manifest (activate it) when True.
|
|
|
|
USE_APPCACHE = False
|
|
|
|
|
|
|
|
# These are absolute paths to add to the cache. Wildcards are not allowed here.
|
|
|
|
# These paths will be added as-is to the cache section.
|
|
|
|
APPCACHE_TO_CACHE = [
|
|
|
|
'/favicon.ico',
|
|
|
|
'https://browserid.org/include.js'
|
|
|
|
]
|
|
|
|
|
2012-06-28 04:15:48 +04:00
|
|
|
APPCACHE_NET_PATHS = [
|
|
|
|
'*'
|
|
|
|
]
|
|
|
|
|
2012-05-21 20:01:40 +04:00
|
|
|
# These are paths relative to MEDIA_ROOT that you want to explicitly
|
|
|
|
# cache. The browser will load *all* of these URLs when your app first loads
|
|
|
|
# so be mindful to only list essential media files. The actual URL of the path
|
|
|
|
# to cache will be determined using MEDIA_URL.
|
|
|
|
# If you use wildcards here the real paths to the file(s) will be
|
|
|
|
# expanded using glob.glob()
|
2012-06-28 04:15:48 +04:00
|
|
|
|
2012-05-21 20:01:40 +04:00
|
|
|
APPCACHE_MEDIA_TO_CACHE = [
|
2012-06-28 04:15:48 +04:00
|
|
|
'js/mkt/consumer-min.js',
|
|
|
|
'css/mkt/consumer-min.css'
|
2012-05-21 20:01:40 +04:00
|
|
|
]
|
2012-06-28 04:15:48 +04:00
|
|
|
|
|
|
|
APPCACHE_MEDIA_DEBUG = []
|
|
|
|
for f in list(asset_bundles.CSS['mkt/consumer']):
|
|
|
|
if f.endswith('.less'):
|
|
|
|
APPCACHE_MEDIA_DEBUG.append(f + '.css')
|
|
|
|
else:
|
|
|
|
APPCACHE_MEDIA_DEBUG.append(f)
|
|
|
|
APPCACHE_MEDIA_DEBUG.extend(asset_bundles.JS['mkt/consumer'])
|
2012-06-28 09:29:07 +04:00
|
|
|
|
|
|
|
# Are you working locally? place the following line in your settings_local:
|
|
|
|
# APPCACHE_MEDIA_TO_CACHE = APPCACHE_MEDIA_DEBUG
|