2010-01-15 05:10:59 +03:00
|
|
|
# -*- coding: utf-8 -*-
|
2009-10-21 03:29:27 +04:00
|
|
|
# Django settings for zamboni project.
|
|
|
|
|
2009-10-21 06:19:17 +04:00
|
|
|
import os
|
2009-12-16 02:53:21 +03:00
|
|
|
import logging
|
2010-01-14 22:16:28 +03:00
|
|
|
import socket
|
2009-12-16 02:53:21 +03:00
|
|
|
|
2010-01-29 22:32:20 +03:00
|
|
|
import product_details
|
2009-12-16 02:53:21 +03:00
|
|
|
|
2010-06-17 00:39:01 +04:00
|
|
|
try:
|
|
|
|
# If we have build ids available, we'll grab them here and add them to our
|
|
|
|
# CACHE_PREFIX. This will let us not have to flush memcache during updates
|
|
|
|
# and it will let us preload data into it before a production push.
|
|
|
|
from build import BUILD_ID_CSS, BUILD_ID_JS
|
|
|
|
build_id = "%s%s" % (BUILD_ID_CSS[:2], BUILD_ID_JS[:2])
|
|
|
|
except ImportError:
|
|
|
|
build_id = ""
|
|
|
|
|
2009-12-16 02:53:21 +03:00
|
|
|
# Make filepaths relative to settings.
|
2009-10-21 06:19:17 +04:00
|
|
|
ROOT = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
path = lambda *a: os.path.join(ROOT, *a)
|
|
|
|
|
2010-02-13 23:41:54 +03:00
|
|
|
# We need to track this because hudson can't just call its checkout "zamboni".
|
|
|
|
# It puts it in a dir called "workspace". Way to be, hudson.
|
|
|
|
ROOT_PACKAGE = os.path.basename(ROOT)
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
DEBUG = True
|
|
|
|
TEMPLATE_DEBUG = DEBUG
|
2009-10-23 02:44:48 +04:00
|
|
|
DEBUG_PROPAGATE_EXCEPTIONS = True
|
2009-10-21 03:29:27 +04:00
|
|
|
|
|
|
|
ADMINS = (
|
|
|
|
# ('Your Name', 'your_email@domain.com'),
|
|
|
|
)
|
|
|
|
MANAGERS = ADMINS
|
|
|
|
|
2010-01-08 03:49:46 +03:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
2010-01-09 01:29:16 +03:00
|
|
|
'NAME': 'zamboni',
|
2010-01-08 03:49:46 +03:00
|
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
|
|
'HOST': '',
|
|
|
|
'PORT': '',
|
|
|
|
'USER': '',
|
|
|
|
'PASSWORD': '',
|
|
|
|
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
|
2010-03-12 11:41:38 +03:00
|
|
|
'TEST_CHARSET': 'utf8',
|
|
|
|
'TEST_COLLATION': 'utf8_general_ci',
|
2010-01-08 03:49:46 +03:00
|
|
|
},
|
2009-12-16 20:54:54 +03:00
|
|
|
}
|
|
|
|
|
2010-08-26 03:23:01 +04:00
|
|
|
DATABASE_ROUTERS = ('multidb.PinningMasterSlaveRouter',)
|
2010-01-26 07:49:23 +03:00
|
|
|
|
2010-01-08 03:49:46 +03:00
|
|
|
# Put the aliases for your slave databases in this list.
|
|
|
|
SLAVE_DATABASES = []
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# Local time zone for this installation. Choices can be found here:
|
|
|
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
|
|
# although not all choices may be available on all operating systems.
|
|
|
|
# If running in a Windows environment this must be set to the same as your
|
|
|
|
# system time zone.
|
2009-10-21 06:19:39 +04:00
|
|
|
TIME_ZONE = 'America/Los_Angeles'
|
2009-10-21 03:29:27 +04:00
|
|
|
|
|
|
|
# Language code for this installation. All choices can be found here:
|
|
|
|
# http://www.i18nguy.com/unicode/language-identifiers.html
|
2009-12-03 01:07:36 +03:00
|
|
|
LANGUAGE_CODE = 'en-US'
|
|
|
|
|
2010-01-29 22:32:20 +03:00
|
|
|
# Accepted locales
|
|
|
|
AMO_LANGUAGES = (
|
2010-07-15 21:21:38 +04:00
|
|
|
'af', 'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en-US', 'es-ES',
|
2010-06-10 19:56:00 +04:00
|
|
|
'eu', 'fa', 'fi', 'fr', 'ga-IE', 'he', 'hu', 'id', 'it', 'ja', 'ko', 'mn',
|
2010-07-15 21:21:38 +04:00
|
|
|
'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sq', 'sr', 'sv-SE',
|
2010-06-10 19:56:00 +04:00
|
|
|
'uk', 'vi', 'zh-CN', 'zh-TW',
|
2010-01-29 22:32:20 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# Override Django's built-in with our native names
|
2010-02-09 21:51:38 +03:00
|
|
|
LANGUAGES = dict([(i.lower(), product_details.languages[i]['native'])
|
2010-01-29 22:32:20 +03:00
|
|
|
for i in AMO_LANGUAGES])
|
2010-02-25 17:57:08 +03:00
|
|
|
RTL_LANGUAGES = ('ar', 'fa', 'fa-IR', 'he')
|
2009-10-21 03:29:27 +04:00
|
|
|
|
2010-02-09 21:51:38 +03:00
|
|
|
LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES])
|
2009-10-21 03:29:27 +04:00
|
|
|
|
2010-03-29 23:45:35 +04:00
|
|
|
TEXT_DOMAIN = 'z-messages'
|
|
|
|
|
2010-08-03 04:46:58 +04:00
|
|
|
TOWER_KEYWORDS = {
|
|
|
|
'_lazy': None,
|
|
|
|
}
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# If you set this to False, Django will make some optimizations so as not
|
|
|
|
# to load the internationalization machinery.
|
|
|
|
USE_I18N = True
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# The host currently running the site. Only use this in code for good reason;
|
|
|
|
# the site is designed to run on a cluster and should continue to support that
|
|
|
|
HOSTNAME = socket.gethostname()
|
|
|
|
|
2010-03-18 00:23:48 +03:00
|
|
|
# The front end domain of the site. If you're not running on a cluster this
|
|
|
|
# might be the same as HOSTNAME but don't depend on that. Use this when you
|
|
|
|
# need the real domain.
|
|
|
|
DOMAIN = HOSTNAME
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# Full base URL for your main site including protocol. No trailing slash.
|
|
|
|
# Example: https://addons.mozilla.org
|
2010-03-18 00:23:48 +03:00
|
|
|
SITE_URL = 'http://%s' % DOMAIN
|
2010-03-16 15:04:30 +03:00
|
|
|
|
2010-07-23 01:18:37 +04:00
|
|
|
# Full URL to your API service. No trailing slash.
|
|
|
|
# Example: https://services.addons.mozilla.org
|
|
|
|
SERVICES_URL = 'http://services.%s' % DOMAIN
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# Absolute path to the directory that holds media.
|
|
|
|
# Example: "/home/media/media.lawrence.com/"
|
2009-10-21 06:19:39 +04:00
|
|
|
MEDIA_ROOT = path('media')
|
2009-10-21 03:29:27 +04:00
|
|
|
|
|
|
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
|
|
# trailing slash if there is a path component (optional in other cases).
|
|
|
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
2010-03-04 20:46:28 +03:00
|
|
|
MEDIA_URL = '/media//'
|
2009-10-21 03:29:27 +04:00
|
|
|
|
2010-06-10 06:23:22 +04:00
|
|
|
# Absolute path to a writable directory shared by all servers. No trailing
|
|
|
|
# slash.
|
|
|
|
# Example: /data/uploads
|
2010-06-17 00:53:24 +04:00
|
|
|
NETAPP_STORAGE = ''
|
|
|
|
|
|
|
|
# Absolute path to a writable directory shared by all servers. No trailing
|
|
|
|
# slash.
|
|
|
|
# Example: /data/uploads
|
|
|
|
UPLOADS_PATH = NETAPP_STORAGE + '/uploads'
|
2010-06-10 06:23:22 +04:00
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
|
|
|
# trailing slash.
|
|
|
|
# Examples: "http://foo.com/media/", "/media/".
|
2009-10-21 06:19:39 +04:00
|
|
|
ADMIN_MEDIA_PREFIX = '/admin-media/'
|
2009-10-21 03:29:27 +04:00
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# paths that don't require an app prefix
|
2010-07-15 21:21:38 +04:00
|
|
|
SUPPORTED_NONAPPS = ('admin', 'developers', 'editors', 'img',
|
2010-05-28 23:47:47 +04:00
|
|
|
'jsi18n', 'localizers', 'media', 'statistics', 'services')
|
2010-03-16 15:04:30 +03:00
|
|
|
DEFAULT_APP = 'firefox'
|
|
|
|
|
|
|
|
# paths that don't require a locale prefix
|
|
|
|
SUPPORTED_NONLOCALES = ('img', 'media', 'services',)
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# Make this unique, and don't share it with anybody.
|
|
|
|
SECRET_KEY = 'r#%9w^o_80)7f%!_ir5zx$tu3mupw9u%&s!)-_q%gy7i+fhx#)'
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# Templates
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
# List of callables that know how to import templates from various sources.
|
|
|
|
TEMPLATE_LOADERS = (
|
|
|
|
'django.template.loaders.filesystem.load_template_source',
|
|
|
|
'django.template.loaders.app_directories.load_template_source',
|
|
|
|
)
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
|
|
'django.core.context_processors.auth',
|
|
|
|
'django.core.context_processors.debug',
|
|
|
|
'django.core.context_processors.media',
|
|
|
|
'django.core.context_processors.request',
|
|
|
|
'django.core.context_processors.csrf',
|
|
|
|
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
|
|
|
|
'amo.context_processors.app',
|
|
|
|
'amo.context_processors.i18n',
|
|
|
|
'amo.context_processors.global_settings',
|
2010-05-14 04:26:15 +04:00
|
|
|
'jingo_minify.helpers.build_ids',
|
2010-03-16 15:04:30 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
TEMPLATE_DIRS = (
|
|
|
|
path('templates'),
|
|
|
|
)
|
|
|
|
|
2010-04-28 20:02:41 +04:00
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
def JINJA_CONFIG():
|
|
|
|
import jinja2
|
|
|
|
from django.conf import settings
|
|
|
|
from caching.base import cache
|
2010-06-26 00:43:34 +04:00
|
|
|
config = {'extensions': ['tower.template.i18n', 'amo.ext.cache',
|
2010-07-16 03:46:37 +04:00
|
|
|
'jinja2.ext.do',
|
2010-03-16 15:04:30 +03:00
|
|
|
'jinja2.ext.with_', 'jinja2.ext.loopcontrols'],
|
|
|
|
'finalize': lambda x: x if x is not None else ''}
|
|
|
|
if 'memcached' in cache.scheme and not settings.DEBUG:
|
|
|
|
# We're passing the _cache object directly to jinja because
|
|
|
|
# Django can't store binary directly; it enforces unicode on it.
|
|
|
|
# Details: http://jinja.pocoo.org/2/documentation/api#bytecode-cache
|
|
|
|
# and in the errors you get when you try it the other way.
|
|
|
|
bc = jinja2.MemcachedBytecodeCache(cache._cache,
|
|
|
|
"%sj2:" % settings.CACHE_PREFIX)
|
|
|
|
config['cache_size'] = -1 # Never clear the cache
|
|
|
|
config['bytecode_cache'] = bc
|
|
|
|
return config
|
|
|
|
|
|
|
|
|
2009-10-21 03:29:27 +04:00
|
|
|
MIDDLEWARE_CLASSES = (
|
2009-12-30 22:01:59 +03:00
|
|
|
# AMO URL middleware comes first so everyone else sees nice URLs.
|
2010-07-02 02:00:17 +04:00
|
|
|
'amo.middleware.TimingMiddleware',
|
2009-12-30 22:01:59 +03:00
|
|
|
'amo.middleware.LocaleAndAppURLMiddleware',
|
2010-05-13 02:27:32 +04:00
|
|
|
'amo.middleware.RemoveSlashMiddleware',
|
2009-12-30 22:01:59 +03:00
|
|
|
|
2010-05-11 22:09:32 +04:00
|
|
|
# Munging REMOTE_ADDR must come before ThreadRequest.
|
|
|
|
'commonware.middleware.SetRemoteAddrFromForwardedFor',
|
2010-08-30 19:27:46 +04:00
|
|
|
'commonware.middleware.FrameOptionsHeader',
|
2010-05-11 22:09:32 +04:00
|
|
|
'commonware.log.ThreadRequestMiddleware',
|
2010-08-26 03:23:01 +04:00
|
|
|
'multidb.middleware.PinningRouterMiddleware',
|
2010-05-11 22:09:32 +04:00
|
|
|
|
2010-05-25 00:19:55 +04:00
|
|
|
'amo.middleware.CommonMiddleware',
|
2010-03-24 23:54:54 +03:00
|
|
|
'amo.middleware.NoVarySessionMiddleware',
|
2010-02-05 02:14:16 +03:00
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
2009-10-21 03:29:27 +04:00
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
2010-01-09 10:16:14 +03:00
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
2009-12-14 23:34:11 +03:00
|
|
|
|
|
|
|
'cake.middleware.CakeCookieMiddleware',
|
2010-05-20 02:23:55 +04:00
|
|
|
'cake.middleware.CookieCleaningMiddleware',
|
|
|
|
|
2010-06-18 21:13:35 +04:00
|
|
|
'amo.middleware.AdminMessageMiddleware',
|
|
|
|
|
2010-01-29 08:00:13 +03:00
|
|
|
# This should come after authentication middleware
|
2010-01-12 03:40:55 +03:00
|
|
|
'access.middleware.ACLMiddleware',
|
2009-10-21 03:29:27 +04:00
|
|
|
)
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# Auth
|
2010-01-13 04:26:20 +03:00
|
|
|
AUTHENTICATION_BACKENDS = (
|
|
|
|
'users.backends.AmoUserBackend',
|
|
|
|
'cake.backends.SessionBackend',
|
|
|
|
)
|
2010-03-16 15:04:30 +03:00
|
|
|
AUTH_PROFILE_MODULE = 'users.UserProfile'
|
2009-10-22 01:48:38 +04:00
|
|
|
|
2010-02-13 23:41:54 +03:00
|
|
|
ROOT_URLCONF = '%s.urls' % ROOT_PACKAGE
|
2009-10-21 03:29:27 +04:00
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
2010-04-21 07:08:27 +04:00
|
|
|
'amo', # amo comes first so it always takes precedence.
|
2010-01-04 00:05:32 +03:00
|
|
|
'access',
|
2009-10-23 02:42:48 +04:00
|
|
|
'addons',
|
2010-02-06 02:38:38 +03:00
|
|
|
'api',
|
2010-01-04 22:04:22 +03:00
|
|
|
'applications',
|
2010-01-16 05:52:56 +03:00
|
|
|
'bandwagon',
|
2010-01-27 01:23:25 +03:00
|
|
|
'blocklist',
|
2010-02-06 01:06:16 +03:00
|
|
|
'browse',
|
2010-02-18 00:14:50 +03:00
|
|
|
'cronjobs',
|
2010-01-05 23:12:04 +03:00
|
|
|
'devhub',
|
2010-04-21 07:08:27 +04:00
|
|
|
'discovery',
|
2010-01-05 01:23:05 +03:00
|
|
|
'editors',
|
2010-01-16 01:52:52 +03:00
|
|
|
'files',
|
2010-05-14 04:26:15 +04:00
|
|
|
'jingo_minify',
|
2010-02-04 05:19:47 +03:00
|
|
|
'nick',
|
2010-03-29 22:02:34 +04:00
|
|
|
'pages',
|
2009-10-23 02:42:48 +04:00
|
|
|
'reviews',
|
2010-01-23 03:52:41 +03:00
|
|
|
'search',
|
2010-03-09 14:52:41 +03:00
|
|
|
'sharing',
|
2010-02-02 05:35:40 +03:00
|
|
|
'stats',
|
2010-01-05 04:46:55 +03:00
|
|
|
'tags',
|
2010-04-14 09:15:16 +04:00
|
|
|
'tower', # for ./manage.py extract
|
2009-12-11 00:21:51 +03:00
|
|
|
'translations',
|
2009-10-23 02:42:48 +04:00
|
|
|
'users',
|
|
|
|
'versions',
|
2010-04-21 07:08:27 +04:00
|
|
|
'zadmin',
|
2009-12-31 01:26:56 +03:00
|
|
|
|
2010-02-13 23:41:54 +03:00
|
|
|
# We need this so the jsi18n view will pick up our locale directory.
|
|
|
|
ROOT_PACKAGE,
|
|
|
|
|
2009-12-14 23:34:11 +03:00
|
|
|
'cake',
|
2010-04-24 03:20:48 +04:00
|
|
|
'celery',
|
2009-12-05 01:55:29 +03:00
|
|
|
'django_nose',
|
2009-12-31 01:26:56 +03:00
|
|
|
|
|
|
|
'django.contrib.admin',
|
2009-10-21 03:29:27 +04:00
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
2010-02-05 02:14:16 +03:00
|
|
|
'django.contrib.messages',
|
2009-10-21 03:29:27 +04:00
|
|
|
'django.contrib.sessions',
|
|
|
|
)
|
2009-12-05 01:55:29 +03:00
|
|
|
|
2010-01-26 02:53:17 +03:00
|
|
|
# These apps will be removed from INSTALLED_APPS in a production environment.
|
|
|
|
DEV_APPS = (
|
|
|
|
'django_nose',
|
|
|
|
)
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# Tests
|
2010-02-01 22:24:26 +03:00
|
|
|
TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
|
2009-12-16 02:53:21 +03:00
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# If you want to run Selenium tests, you'll need to have a server running.
|
|
|
|
# Then give this a dictionary of settings. Something like:
|
|
|
|
# 'HOST': 'localhost',
|
|
|
|
# 'PORT': 4444,
|
|
|
|
# 'BROWSER': '*firefox', # Alternative: *safari
|
|
|
|
SELENIUM_CONFIG = {}
|
2010-03-09 00:41:36 +03:00
|
|
|
|
|
|
|
# Tells the extract script what files to look for l10n in and what function
|
|
|
|
# handles the extraction. The Tower library expects this.
|
|
|
|
DOMAIN_METHODS = {
|
|
|
|
'messages': [
|
|
|
|
('apps/**.py',
|
2010-04-14 09:15:16 +04:00
|
|
|
'tower.management.commands.extract.extract_tower_python'),
|
2010-03-09 00:41:36 +03:00
|
|
|
('**/templates/**.html',
|
2010-04-14 09:15:16 +04:00
|
|
|
'tower.management.commands.extract.extract_tower_template'),
|
2010-03-09 00:41:36 +03:00
|
|
|
],
|
|
|
|
'lhtml': [
|
|
|
|
('**/templates/**.lhtml',
|
2010-04-14 09:15:16 +04:00
|
|
|
'tower.management.commands.extract.extract_tower_template'),
|
2010-03-09 00:41:36 +03:00
|
|
|
],
|
|
|
|
'javascript': [
|
|
|
|
# We can't say **.js because that would dive into mochikit and timeplot
|
|
|
|
# and all the other baggage we're carrying. Timeplot, in particular,
|
|
|
|
# crashes the extractor with bad unicode data.
|
|
|
|
('media/js/*.js', 'javascript'),
|
|
|
|
('media/js/amo2009/**.js', 'javascript'),
|
|
|
|
('media/js/zamboni/**.js', 'javascript'),
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2010-05-27 04:46:51 +04:00
|
|
|
# These domains will not be merged into z-keys.pot and will use separate PO
|
2010-05-21 03:46:55 +04:00
|
|
|
# files.
|
|
|
|
STANDALONE_DOMAINS = [
|
|
|
|
'javascript',
|
|
|
|
]
|
|
|
|
|
2010-03-09 19:55:16 +03:00
|
|
|
# Bundles is a dictionary of two dictionaries, css and js, which list css files
|
|
|
|
# and js files that can be bundled together by the minify app.
|
|
|
|
MINIFY_BUNDLES = {
|
|
|
|
'css': {
|
|
|
|
# CSS files common to the entire site.
|
2010-03-09 22:54:33 +03:00
|
|
|
'common': (
|
|
|
|
'css/main.css',
|
|
|
|
'css/main-mozilla.css',
|
2010-03-05 19:32:48 +03:00
|
|
|
'css/jquery-lightbox.css',
|
|
|
|
'css/autocomplete.css',
|
|
|
|
),
|
2010-03-20 01:48:15 +03:00
|
|
|
'zamboni/z': (
|
|
|
|
'css/zamboni/zamboni.css',
|
2010-04-16 21:55:20 +04:00
|
|
|
'css/zamboni/tags.css',
|
|
|
|
'css/zamboni/tabs.css',
|
2010-03-20 01:48:15 +03:00
|
|
|
),
|
2010-04-21 07:08:27 +04:00
|
|
|
'zamboni/discovery-pane': (
|
|
|
|
'css/zamboni/discovery-pane.css',
|
2010-04-28 20:02:41 +04:00
|
|
|
),
|
2010-03-09 19:55:16 +03:00
|
|
|
},
|
|
|
|
'js': {
|
|
|
|
# JS files common to the entire site.
|
|
|
|
'common': (
|
2010-03-19 02:33:04 +03:00
|
|
|
'js/zamboni/jquery-1.4.2.min.js',
|
2010-03-09 22:54:33 +03:00
|
|
|
'js/zamboni/underscore-min.js',
|
|
|
|
'js/amo2009/addons.js',
|
|
|
|
'js/zamboni/init.js',
|
2010-03-09 22:50:01 +03:00
|
|
|
'js/zamboni/buttons.js',
|
2010-03-13 06:36:18 +03:00
|
|
|
'js/zamboni/search.js',
|
2010-04-10 08:02:46 +04:00
|
|
|
'js/zamboni/tabs.js',
|
2010-03-09 22:54:33 +03:00
|
|
|
|
|
|
|
'js/jquery.cookie.js',
|
|
|
|
'js/amo2009/global.js',
|
|
|
|
'js/jquery-ui/jqModal.js',
|
|
|
|
'js/amo2009/home.js',
|
2010-03-05 19:32:48 +03:00
|
|
|
|
2010-08-25 20:32:46 +04:00
|
|
|
# Homepage
|
|
|
|
'js/zamboni/homepage.js',
|
|
|
|
|
2010-04-28 04:14:19 +04:00
|
|
|
# Add-ons details page
|
2010-03-05 19:32:48 +03:00
|
|
|
'js/jquery-ui/ui.lightbox.js',
|
2010-06-11 02:33:42 +04:00
|
|
|
'js/jquery.autocomplete.min.js',
|
2010-04-28 04:14:19 +04:00
|
|
|
'js/zamboni/tags.js',
|
2010-03-05 19:32:48 +03:00
|
|
|
'js/get-satisfaction-v2.js',
|
|
|
|
'js/zamboni/contributions.js',
|
|
|
|
'js/zamboni/addon_details.js',
|
2010-06-29 04:52:32 +04:00
|
|
|
'js/zamboni/reviews.js',
|
2010-03-24 22:06:02 +03:00
|
|
|
|
|
|
|
# Personas
|
|
|
|
'js/zamboni/jquery.hoverIntent.min.js',
|
|
|
|
'js/zamboni/personas.js',
|
2010-05-07 01:11:26 +04:00
|
|
|
|
|
|
|
# Collections
|
2010-07-27 22:35:26 +04:00
|
|
|
'js/zamboni/jquery-ui/custom-1.8.2.min.js',
|
2010-05-07 01:11:26 +04:00
|
|
|
'js/zamboni/collections.js',
|
2010-08-19 22:51:32 +04:00
|
|
|
|
|
|
|
# Users
|
|
|
|
'js/zamboni/users.js',
|
2010-03-05 19:32:48 +03:00
|
|
|
),
|
2010-03-09 19:55:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-16 15:04:30 +03:00
|
|
|
# Caching
|
2010-01-27 01:01:21 +03:00
|
|
|
# Prefix for cache keys (will prevent collisions when running parallel copies)
|
2010-06-17 00:39:01 +04:00
|
|
|
CACHE_PREFIX = 'amo:%s:' % build_id
|
2010-06-05 00:43:48 +04:00
|
|
|
FETCH_BY_ID = True
|
2010-01-27 01:01:21 +03:00
|
|
|
|
2010-02-20 00:37:18 +03:00
|
|
|
# Number of seconds a count() query should be cached. Keep it short because
|
|
|
|
# it's not possible to invalidate these queries.
|
|
|
|
CACHE_COUNT_TIMEOUT = 60
|
|
|
|
|
2010-03-04 20:46:28 +03:00
|
|
|
# External tools.
|
2010-01-23 03:52:41 +03:00
|
|
|
SPHINX_INDEXER = 'indexer'
|
|
|
|
SPHINX_SEARCHD = 'searchd'
|
|
|
|
SPHINX_CONFIG_PATH = path('configs/sphinx/sphinx.conf')
|
2010-04-28 23:54:48 +04:00
|
|
|
SPHINX_CATALOG_PATH = '/tmp/data/sphinx'
|
|
|
|
SPHINX_DATA_PATH = '/tmp/log/searchd'
|
2010-01-23 03:52:41 +03:00
|
|
|
SPHINX_HOST = '127.0.0.1'
|
|
|
|
SPHINX_PORT = 3312
|
2010-02-02 23:22:24 +03:00
|
|
|
|
2010-03-04 20:46:28 +03:00
|
|
|
JAVA_BIN = '/usr/bin/java'
|
|
|
|
|
2010-06-10 06:23:22 +04:00
|
|
|
# File paths
|
2010-08-14 08:31:30 +04:00
|
|
|
ADDON_ICONS_PATH = UPLOADS_PATH + '/addon_icons'
|
|
|
|
COLLECTIONS_ICON_PATH = UPLOADS_PATH + '/collection_icons'
|
|
|
|
PREVIEWS_PATH = UPLOADS_PATH + '/previews'
|
2010-06-10 06:23:22 +04:00
|
|
|
USERPICS_PATH = UPLOADS_PATH + '/userpics'
|
|
|
|
|
2010-02-02 23:22:24 +03:00
|
|
|
# URL paths
|
|
|
|
# paths for images, e.g. mozcdn.com/amo or '/static'
|
|
|
|
STATIC_URL = SITE_URL
|
|
|
|
ADDON_ICON_URL = "%s/%s/%s/images/addon_icon/%%d/%%s" % (
|
|
|
|
STATIC_URL, LANGUAGE_CODE, DEFAULT_APP)
|
|
|
|
PREVIEW_THUMBNAIL_URL = (STATIC_URL +
|
|
|
|
'/img/uploads/previews/thumbs/%s/%d.png?modified=%d')
|
2010-02-26 18:45:34 +03:00
|
|
|
PREVIEW_FULL_URL = (STATIC_URL +
|
|
|
|
'/img/uploads/previews/full/%s/%d.png?modified=%d')
|
2010-08-21 00:45:53 +04:00
|
|
|
USERPICS_URL = STATIC_URL + '/img/uploads/userpics/%s/%s/%s.png?modified=%d'
|
2010-02-02 23:22:24 +03:00
|
|
|
# paths for uploaded extensions
|
2010-05-25 04:02:29 +04:00
|
|
|
FILES_URL = STATIC_URL + "/%s/%s/downloads/file/%d/%s?src=%s"
|
2010-03-02 05:17:13 +03:00
|
|
|
COLLECTION_ICON_URL = ('%s/%s/%s/images/collection_icon/%%s/%%s' %
|
|
|
|
(STATIC_URL, LANGUAGE_CODE, DEFAULT_APP))
|
2010-06-10 05:19:19 +04:00
|
|
|
PERSONAS_IMAGE_URL = ('http://www.getpersonas.com/static/'
|
2010-03-26 20:58:32 +03:00
|
|
|
'%(tens)d/%(units)d/%(id)d/%(file)s')
|
2010-06-10 05:19:19 +04:00
|
|
|
PERSONAS_IMAGE_URL_SSL = ('https://www.getpersonas.com/static/'
|
2010-03-24 22:06:02 +03:00
|
|
|
'%(tens)d/%(units)d/%(id)d/%(file)s')
|
2010-06-10 05:19:19 +04:00
|
|
|
PERSONAS_USER_ROOT = 'http://www.getpersonas.com/gallery/designer/%s'
|
2010-03-02 18:43:39 +03:00
|
|
|
|
2010-03-16 18:30:15 +03:00
|
|
|
# Outgoing URL bouncer
|
2010-03-30 03:01:24 +04:00
|
|
|
REDIRECT_URL = 'http://outgoing.mozilla.org/v1/'
|
2010-03-16 18:30:15 +03:00
|
|
|
REDIRECT_SECRET_KEY = ''
|
|
|
|
|
2010-03-13 05:09:00 +03:00
|
|
|
# Default to short expiration; check "remember me" to override
|
|
|
|
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
|
|
|
SESSION_COOKIE_AGE = 1209600
|
|
|
|
SESSION_COOKIE_SECURE = True
|
|
|
|
|
|
|
|
# These should have app+locale at the start to avoid redirects
|
|
|
|
LOGIN_URL = "/users/login"
|
|
|
|
LOGOUT_URL = "/users/logout"
|
|
|
|
LOGIN_REDIRECT_URL = "/"
|
|
|
|
LOGOUT_REDIRECT_URL = "/"
|
|
|
|
|
2010-03-02 18:43:39 +03:00
|
|
|
# Legacy Settings
|
|
|
|
# used by old-style CSRF token
|
|
|
|
CAKE_SESSION_TIMEOUT = 8640
|
2010-03-16 23:18:11 +03:00
|
|
|
|
2010-03-15 23:37:20 +03:00
|
|
|
# PayPal Settings
|
|
|
|
PAYPAL_CGI_URL = 'https://www.paypal.com/cgi-bin/webscr'
|
2010-06-23 21:08:16 +04:00
|
|
|
PAYPAL_BN = ''
|
2010-03-15 23:37:20 +03:00
|
|
|
|
2010-03-16 23:18:11 +03:00
|
|
|
# Email settings
|
2010-04-10 07:49:36 +04:00
|
|
|
DEFAULT_FROM_EMAIL = "Mozilla Add-ons <nobody@mozilla.org>"
|
2010-03-16 23:18:11 +03:00
|
|
|
|
2010-04-06 02:22:05 +04:00
|
|
|
# Email goes to the console by default. s/console/smtp/ for regular delivery
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
|
|
|
2010-03-16 23:18:11 +03:00
|
|
|
# Please use all lowercase for the blacklist.
|
|
|
|
EMAIL_BLACKLIST = (
|
|
|
|
'nobody@mozilla.org',
|
|
|
|
)
|
2010-04-24 03:20:48 +04:00
|
|
|
|
|
|
|
|
|
|
|
## Celery
|
|
|
|
BROKER_HOST = 'localhost'
|
|
|
|
BROKER_PORT = 5672
|
|
|
|
BROKER_USER = 'zamboni'
|
|
|
|
BROKER_PASSWORD = 'zamboni'
|
|
|
|
BROKER_VHOST = 'zamboni'
|
2010-08-17 01:31:53 +04:00
|
|
|
BROKER_CONNECTION_TIMEOUT = 0.1
|
2010-04-24 03:20:48 +04:00
|
|
|
CELERY_RESULT_BACKEND = 'amqp'
|
2010-05-25 05:39:11 +04:00
|
|
|
CELERY_IGNORE_RESULT = True
|
|
|
|
|
2010-05-19 01:23:37 +04:00
|
|
|
|
|
|
|
## Fixture Magic
|
|
|
|
CUSTOM_DUMPS = {
|
|
|
|
'addon': { # ./manage.py custom_dump addon id
|
|
|
|
'primary': 'addons.addon', # This is our reference model.
|
|
|
|
'dependents': [ # These are items we wish to dump.
|
|
|
|
# Magic turns this into current_version.files.all()[0].
|
|
|
|
'current_version.files.all.0',
|
2010-08-11 02:28:10 +04:00
|
|
|
'current_version.apps.all.0',
|
2010-08-11 03:04:01 +04:00
|
|
|
'addonuser_set.all.0',
|
2010-05-19 01:23:37 +04:00
|
|
|
],
|
2010-08-11 02:28:10 +04:00
|
|
|
'order': ('applications.application', 'translations.translation',
|
|
|
|
'addons.addontype', 'files.platform', 'addons.addon',
|
|
|
|
'versions.license', 'versions.version', 'files.file'),
|
2010-06-24 03:56:45 +04:00
|
|
|
'excludes': {
|
2010-06-26 02:21:17 +04:00
|
|
|
'addons.addon': ('_current_version',),
|
2010-06-24 03:56:45 +04:00
|
|
|
}
|
2010-05-19 01:23:37 +04:00
|
|
|
}
|
|
|
|
}
|
2010-05-28 23:47:47 +04:00
|
|
|
|
2010-07-22 00:58:05 +04:00
|
|
|
## Hera (http://github.com/clouserw/hera)
|
2010-08-10 21:40:50 +04:00
|
|
|
HERA = [{'USERNAME': '',
|
2010-07-22 00:58:05 +04:00
|
|
|
'PASSWORD': '',
|
|
|
|
'LOCATION': '',
|
2010-08-10 21:40:50 +04:00
|
|
|
}]
|
2010-06-30 02:28:40 +04:00
|
|
|
|
2010-05-28 23:47:47 +04:00
|
|
|
# Logging
|
|
|
|
LOG_LEVEL = logging.DEBUG
|
|
|
|
HAS_SYSLOG = True # syslog is used if HAS_SYSLOG and NOT DEBUG.
|
|
|
|
SYSLOG_TAG = "http_app_addons"
|
|
|
|
# See PEP 391 and log_settings.py for formatting help. Each section of LOGGING
|
|
|
|
# will get merged into the corresponding section of log_settings.py.
|
|
|
|
# Handlers and log levels are set up automatically based on LOG_LEVEL and DEBUG
|
|
|
|
# unless you set them here. Messages will not propagate through a logger
|
|
|
|
# unless propagate: True is set.
|
|
|
|
LOGGING = {
|
|
|
|
'loggers': {
|
2010-06-11 07:00:56 +04:00
|
|
|
'amqplib': {'handlers': ['null']},
|
2010-05-28 23:47:47 +04:00
|
|
|
'caching': {'handlers': ['null']},
|
2010-06-30 02:28:40 +04:00
|
|
|
'suds': {'handlers': ['null']},
|
2010-06-03 07:08:09 +04:00
|
|
|
'z.sphinx': {'level': logging.INFO},
|
2010-06-05 02:29:48 +04:00
|
|
|
'z.task': {'level': logging.INFO},
|
2010-05-28 23:47:47 +04:00
|
|
|
},
|
|
|
|
}
|
2010-06-23 04:38:28 +04:00
|
|
|
|
2010-07-20 22:31:57 +04:00
|
|
|
# If you don't want experimental add-ons to show up in any search results or
|
|
|
|
# have detail pages, flip this switch
|
|
|
|
SANDBOX_PANIC = False
|
2010-06-23 04:38:28 +04:00
|
|
|
|
|
|
|
# Read-only mode setup.
|
|
|
|
READ_ONLY = False
|
|
|
|
|
2010-06-26 02:21:17 +04:00
|
|
|
|
2010-06-23 04:38:28 +04:00
|
|
|
# Turn on read-only mode in settings_local.py by putting this line
|
|
|
|
# at the VERY BOTTOM: read_only_mode(globals())
|
|
|
|
def read_only_mode(env):
|
|
|
|
env['READ_ONLY'] = True
|
|
|
|
|
|
|
|
# Replace the default (master) db with a slave connection.
|
|
|
|
if not env.get('SLAVE_DATABASES'):
|
|
|
|
raise Exception("We need at least one slave database.")
|
|
|
|
slave = env['SLAVE_DATABASES'][0]
|
|
|
|
env['DATABASES']['default'] = env['DATABASES'][slave]
|
|
|
|
|
|
|
|
# No sessions without the database, so disable auth.
|
|
|
|
env['AUTHENTICATION_BACKENDS'] = ()
|
|
|
|
|
|
|
|
# Add in the read-only middleware before csrf middleware.
|
|
|
|
extra = 'amo.middleware.ReadOnlyMiddleware'
|
|
|
|
before = 'django.middleware.csrf.CsrfViewMiddleware'
|
|
|
|
m = list(env['MIDDLEWARE_CLASSES'])
|
|
|
|
m.insert(m.index(before), extra)
|
|
|
|
env['MIDDLEWARE_CLASSES'] = tuple(m)
|
2010-07-16 03:46:37 +04:00
|
|
|
|
|
|
|
|
2010-07-27 22:35:26 +04:00
|
|
|
# Uploaded file limits
|
|
|
|
MAX_ICON_UPLOAD_SIZE = 4 * 1024 * 1024
|
2010-08-21 00:45:53 +04:00
|
|
|
MAX_PHOTO_UPLOAD_SIZE = MAX_ICON_UPLOAD_SIZE
|
2010-07-27 22:35:26 +04:00
|
|
|
|
2010-07-16 03:46:37 +04:00
|
|
|
## Feature switches
|
|
|
|
# Use this to keep collections compatible with remora before we're ready to
|
|
|
|
# switch to zamboni/bandwagon3.
|
|
|
|
NEW_COLLECTIONS = True
|
2010-08-19 21:42:01 +04:00
|
|
|
|
2010-08-19 22:51:32 +04:00
|
|
|
# RECAPTCHA - copy all three statements to settings_local.py
|
2010-08-24 21:38:15 +04:00
|
|
|
RECAPTCHA_PUBLIC_KEY = ''
|
|
|
|
RECAPTCHA_PRIVATE_KEY = ''
|
2010-08-19 22:51:32 +04:00
|
|
|
RECAPTCHA_URL = ('https://api-secure.recaptcha.net/challenge?k=%s' %
|
|
|
|
RECAPTCHA_PUBLIC_KEY)
|