diff --git a/src/colab/colab.template.yaml b/src/colab/colab.template.yaml new file mode 100644 index 0000000..13dbaaa --- /dev/null +++ b/src/colab/colab.template.yaml @@ -0,0 +1,53 @@ + +DEBUG: false +TEMPLATE_DEBUG: false + +ADMINS: &admin + - + - John Foo + - john@example.com + - + - Mary Bar + - mary@example.com + +MANAGERS: *admin + +COLAB_FROM_ADDRESS: '"Colab" ' +SERVER_EMAIL: '"Colab" ' + +EMAIL_HOST: localhost +EMAIL_PORT: 25 +EMAIL_SUBJECT_PREFIX: '[colab]' + +SECRET_KEY: '{{ secret_key }}' + +SITE_URL: 'http://www.example.com/' + +ALLOWED_HOSTS: + - example.com + - example.org + - example.net + +CONVERSEJS_ENABLED: false + +CONVERSEJS_AUTO_REGISTER: 'xmpp.example.com' + +DATABASES: + default: + ENGINE: django.db.backends.postgresql_psycopg2 + HOST: localhost + NAME: colab + USER: colab + PASSWORD: colab + +ROBOTS_NOINDEX: false + +# Set to false to disable +RAVEN_DSN: 'http://public:secret@example.com/1' + +PROXIED_APPS: + gitlab: + upstream: 'http://localhost:8090/gitlab/' + trac: + upstream: 'http://localhost:5000/trac/' + diff --git a/src/colab/custom_settings.py b/src/colab/custom_settings.py deleted file mode 100644 index 98019cc..0000000 --- a/src/colab/custom_settings.py +++ /dev/null @@ -1,313 +0,0 @@ -from settings import * -from django.utils.translation import ugettext_lazy as _ - -# Allow Django runserver to serve SVG files -# https://code.djangoproject.com/ticket/20162 -import mimetypes -mimetypes.add_type('image/svg+xml', '.svg') - -DEBUG = False - -TEMPLATE_DEBUG = False - -LANGUAGES = ( - ('en', _('English')), - ('pt-br', _('Portuguese')), - ('es', _('Spanish')), -) - -DJANGO_DATE_FORMAT_TO_JS = { - 'pt-br': ('pt-BR', 'dd/MM/yyyy'), - 'es': ('es', 'dd/MM/yyyy'), -} - -LANGUAGE_CODE = 'en' - -# The absolute path to the folder containing the attachments -ATTACHMENTS_FOLDER_PATH = '/mnt/trac/attachments/' - -# ORDERING_DATA receives the options to order for as it's keys and a dict as -# value, if you want to order for the last name, you can use something like: -# 'last_name': {'name': 'Last Name', 'fields': 'last_name'} inside the dict, -# you pass two major keys (name, fields) -# The major key name is the name to appear on the template -# the major key fields it show receive the name of the fields to order for in -# the indexes - -ORDERING_DATA = { - 'latest': { - 'name': _(u'Recent activity'), - 'fields': ('-modified', '-created'), - }, - 'hottest': { - 'name': _(u'Relevance'), - 'fields': None, - }, -} - -# File type groupings is a tuple of tuples containg what it should filter, -# how it should be displayed, and a tuple of which mimetypes it includes -FILE_TYPE_GROUPINGS = ( - ('document', _(u'Document'), - ('doc', 'docx', 'odt', 'otx', 'dotx', 'pdf', 'ott')), - ('presentation', _(u'Presentation'), ('ppt', 'pptx', 'odp')), - ('text', _(u'Text'), ('txt', 'po', 'conf', 'log')), - ('code', _(u'Code'), - ('py', 'php', 'js', 'sql', 'sh', 'patch', 'diff', 'html', '')), - ('compressed', _(u'Compressed'), ('rar', 'zip', 'gz', 'tgz', 'bz2')), - ('image', _(u'Image'), - ('jpg', 'jpeg', 'png', 'tiff', 'gif', 'svg', 'psd', 'planner', 'cdr')), - ('spreadsheet', _(u'Spreadsheet'), - ('ods', 'xls', 'xlsx', 'xslt', 'csv')), -) - - -# the following variable define how many characters should be shown before -# a highlighted word, to make sure that the highlighted word will appear -HIGHLIGHT_NUM_CHARS_BEFORE_MATCH = 30 -HAYSTACK_CUSTOM_HIGHLIGHTER = 'colab.utils.highlighting.ColabHighlighter' - -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': os.environ.get('COLAB_SOLR_URL', 'http://localhost:8983/solr'), - } -} - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'colab', - 'USER': 'colab', - 'PASSWORD': os.environ.get('COLAB_DEFAULT_DB_PWD'), - 'HOST': os.environ.get('COLAB_DEFAULT_DB_HOST'), - }, -} - -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', - } -} - -DATABASE_ROUTERS = [] - -INSTALLED_APPS += ( - # First app to provide AUTH_USER_MODEL to others - 'accounts', - - # Not standard apps - 'raven.contrib.django.raven_compat', - 'cliauth', - 'django_mobile', - 'django_browserid', - 'conversejs', - 'haystack', - 'hitcounter', - 'i18n_model', - 'mptt', - 'dpaste', - - # Own apps - 'super_archives', - 'api', - 'rss', - 'planet', - 'search', - 'badger', - 'tz', - - # Feedzilla and deps - 'feedzilla', - 'taggit', - 'common', -) - -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'root': { - 'level': 'WARNING', - 'handlers': ['sentry', 'console'], - }, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s', - }, - }, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'class': 'django.utils.log.AdminEmailHandler', - 'include_html': True, - 'filters': ['require_debug_false'], - }, - 'sentry': { - 'level': 'ERROR', - 'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', - }, - 'console': { - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'verbose' - } - }, - 'loggers': { - 'django.request': { - 'handlers': ['mail_admins', 'sentry'], - 'level': 'ERROR', - 'propagate': True, - }, - 'django.db.backends': { - 'level': 'ERROR', - 'handlers': ['sentry'], - 'propagate': False, - }, - 'raven': { - 'level': 'DEBUG', - 'handlers': ['console'], - 'propagate': False, - }, - 'sentry.errors': { - 'level': 'DEBUG', - 'handlers': ['console'], - 'propagate': False, - }, - 'django_browserid': { - 'handlers': ['sentry'], - 'level': 'WARNING', - 'propagate': False, - }, - 'conversejs': { - 'handlers': ['console'], - 'level': 'DEBUG', - 'propagate': False, - }, - } -} - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.static', - 'django.core.context_processors.tz', - 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.request', - 'django_mobile.context_processors.is_mobile', - 'super_archives.context_processors.mailarchive', - 'proxy.context_processors.proxied_apps', - 'home.context_processors.robots', -) - -MIDDLEWARE_CLASSES = ( - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django_mobile.middleware.MobileDetectionMiddleware', - 'django_mobile.middleware.SetFlavourMiddleware', - 'tz.middleware.TimezoneMiddleware', -) - -# Add the django_browserid authentication backend. -AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - 'accounts.auth.ColabBrowserIDBackend', -) - -STATICFILES_DIRS = ( - os.path.join(BASE_DIR, 'static'), -) - -STATIC_ROOT = '/usr/share/nginx/colab/static/' -MEDIA_ROOT = '/usr/share/nginx/colab/media/' - -TEMPLATE_DIRS = ( - os.path.join(BASE_DIR, 'templates'), -) - -LOCALE_PATHS = ( - os.path.join(BASE_DIR, 'locale'), -) - -AUTH_USER_MODEL = 'accounts.User' - -ALLOWED_HOSTS = [] - -from django.contrib.messages import constants as messages -MESSAGE_TAGS = { - messages.INFO: 'alert-info', - messages.SUCCESS: 'alert-success', - messages.WARNING: 'alert-warning', - messages.ERROR: 'alert-danger', -} - -### Feedzilla (planet) -from feedzilla.settings import * -FEEDZILLA_PAGE_SIZE = 5 -FEEDZILLA_SITE_TITLE = _(u'Planet Colab') -FEEDZILLA_SITE_DESCRIPTION = _(u'Colab blog aggregator') - - -### Mailman API settings -MAILMAN_API_URL = 'http://localhost:9000' - - -### BrowserID / Persona -SITE_URL = 'localhost:8000' -BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')] - - -LOGIN_URL = '/' -LOGIN_REDIRECT_URL = '/' -LOGIN_REDIRECT_URL_FAILURE = '/' -LOGOUT_REDIRECT_URL = '/user/logout' -BROWSERID_CREATE_USER = False - - -## Proxy settings -COLAB_CI_URL = 'localhost:9000/ci/' - -REVPROXY_ADD_REMOTE_USER = True - - -## Converse.js settings -# This URL must use SSL in order to keep chat sessions secure -CONVERSEJS_BOSH_SERVICE_URL = SITE_URL + '/http-bind' - -CONVERSEJS_ALLOW_CONTACT_REQUESTS = False -CONVERSEJS_SHOW_ONLY_ONLINE_USERS = True - - -# Tastypie settings -TASTYPIE_DEFAULT_FORMATS = ['json', ] - - -# Dpaste settings -DPASTE_EXPIRE_CHOICES = ( - ('onetime', _(u'One Time Snippet')), - (3600, _(u'In one hour')), - (3600 * 24 * 7, _(u'In one week')), - (3600 * 24 * 30, _(u'In one month')), - ('never', _(u'Never')), -) -DPASTE_EXPIRE_DEFAULT = DPASTE_EXPIRE_CHOICES[4][0] -DPASTE_DEFAULT_GIST_DESCRIPTION = 'Gist created from Colab DPaste' -DPASTE_DEFAULT_GIST_NAME = 'colab_paste' -DPASTE_LEXER_DEFAULT = 'text' - -try: - from local_settings import * -except ImportError: - pass diff --git a/src/colab/local_settings-dev.py b/src/colab/local_settings-dev.py deleted file mode 100644 index 5c1d893..0000000 --- a/src/colab/local_settings-dev.py +++ /dev/null @@ -1,61 +0,0 @@ - -from custom_settings import * - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( -) - -MANAGERS = ADMINS - -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -#EMAIL_HOST = '' -#EMAIL_PORT = 587 -EMAIL_SUBJECT_PREFIX = '' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = ')(jksdfhsjkadfhjkh234ns!8fqu-1186h$vuj' - -SITE_URL = 'http://localhost:8000' -BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')] - -ALLOWED_HOSTS = ['*'] - -INTERNAL_IPS = ('127.0.0.1', ) - -CONVERSEJS_BOSH_SERVICE_URL = 'http://localhost:5280/http-bind' - -DATABASES['default']['PASSWORD'] = 'colab' -DATABASES['default']['HOST'] = 'localhost' - -HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/' - -COLAB_TRAC_URL = 'http://localhost:5000/trac/' -COLAB_CI_URL = 'http://localhost:8080/ci/' -COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/' -COLAB_REDMINE_URL = 'http://localhost:9080/redmine/' - - -CONVERSEJS_ENABLED = False - -DIAZO_THEME = SITE_URL - -ROBOTS_NOINDEX = True - - -### Trac Settings - -#INSTALLED_APPS += ( -# 'proxy.trac', -#) -# -#DATABASE_ROUTERS += ['proxy.trac.routers.TracRouter'] -# -#DATABASES['trac'] = { -# 'ENGINE': 'django.db.backends.postgresql_psycopg2', -# 'NAME': 'trac_colab', -# 'USER': 'colab', -# 'PASSWORD': 'colab', -# 'HOST': 'localhost', -#} diff --git a/src/colab/local_settings-homolog.py b/src/colab/local_settings-homolog.py deleted file mode 100644 index 3e2322b..0000000 --- a/src/colab/local_settings-homolog.py +++ /dev/null @@ -1,65 +0,0 @@ - -import os -import json - -from custom_settings import * - -SECRETS_FILE = '/home/colab/colab/secrets.json' - -if os.path.exists(SECRETS_FILE): - secrets = json.load(file(SECRETS_FILE)) - - -DEBUG = False -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - ('Paulo Meirelles', 'paulo@softwarelivre.org'), -) - -MANAGERS = ADMINS - -COLAB_FROM_ADDRESS = '"Portal do Software Publico" ' -SERVER_EMAIL = COLAB_FROM_ADDRESS -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' -EMAIL_HOST = 'localhost' -EMAIL_PORT = 25 -EMAIL_SUBJECT_PREFIX = '' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = secrets.get('SECRET_KEY') - -SITE_URL = 'http://beta.softwarepublico.gov.br' -BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')] - -ALLOWED_HOSTS = ['beta.softwarepublico.gov.br'] - -INTERNAL_IPS = ('127.0.0.1', ) - -DATABASES['default']['PASSWORD'] = secrets.get('COLAB_DB_PWD') -DATABASES['default']['HOST'] = 'localhost' - -TRAC_ENABLED = True - -if TRAC_ENABLED: - from trac_settings import * - DATABASES['trac'] = TRAC_DATABASE - DATABASES['trac']['PASSWORD'] = secrets.get('TRAC_DB_PWD') - DATABASES['trac']['HOST'] = 'localhost' - -HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/' - -COLAB_TRAC_URL = 'http://localhost:5000/trac/' -COLAB_CI_URL = 'http://localhost:8080/ci/' -COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/' -COLAB_REDMINE_URL = 'http://localhost:9080/redmine/' - -CONVERSEJS_ENABLED = False - -DIAZO_THEME = SITE_URL - -ROBOTS_NOINDEX = True - -RAVEN_CONFIG = { - 'dsn': secrets.get('RAVEN_DSN', '') + '?timeout=30', -} diff --git a/src/colab/local_settings-prod.py b/src/colab/local_settings-prod.py deleted file mode 100644 index 0d54252..0000000 --- a/src/colab/local_settings-prod.py +++ /dev/null @@ -1,54 +0,0 @@ - -import os -import json - -from custom_settings import * - -SECRETS_FILE = '/home/colab/colab/secrets.json' - -if os.path.exists(SECRETS_FILE): - secrets = json.load(file(SECRETS_FILE)) - -DEBUG = False -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - ('Name Surname', 'email@provider.com'), -) -MANAGERS = ADMINS - -COLAB_FROM_ADDRESS = '"Colab" ' -SERVER_EMAIL = COLAB_FROM_ADDRESS -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' -EMAIL_HOST = '' -EMAIL_PORT = 25 -EMAIL_SUBJECT_PREFIX = '' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = secrets.get('SECRET_KEY') - -SITE_URL = '' -ALLOWED_HOSTS = [] - -# XMPP Server -CONVERSEJS_AUTO_REGISTER = '' - -DATABASES['default']['PASSWORD'] = secrets.get('COLAB_DB_PWD') -DATABASES['default']['HOST'] = 'localhost' - -DATABASES['trac'] = 'trac_colab' -DATABASES['trac']['PASSWORD'] = secrets.get('TRAC_DB_PWD') -DATABASES['trac']['HOST'] = 'localhost' - -HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/' - -COLAB_TRAC_URL = 'http://localhost:5000/trac/' -COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/' - -CONVERSEJS_ENABLED = False - -ROBOTS_NOINDEX = False - -RAVEN_CONFIG = { - 'dsn': secrets.get('RAVEN_DSN', '') + '?timeout=30', -} diff --git a/src/colab/settings.py b/src/colab/settings.py index 56e24e8..f3361c8 100644 --- a/src/colab/settings.py +++ b/src/colab/settings.py @@ -2,22 +2,24 @@ Django settings for colab project. For more information on this file, see -https://docs.djangoproject.com/en/dev/topics/settings/ +https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/dev/ref/settings/ +https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +# Used for settings translation +from django.utils.translation import ugettext_lazy as _ # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'd%gy$gfn4z2=z414qvqouyd2h6_i8nr_m4zmlxqklu15u!8&^@' +SECRET_KEY = "{{ secret_key }}" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -26,6 +28,7 @@ TEMPLATE_DEBUG = True ALLOWED_HOSTS = [] +DATABASE_ROUTERS = [] # Application definition @@ -36,6 +39,35 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + + # First app to provide AUTH_USER_MODEL to others + 'accounts', + + # Not standard apps + 'raven.contrib.django.raven_compat', + 'cliauth', + 'django_mobile', + 'django_browserid', + 'conversejs', + 'haystack', + 'hitcounter', + 'i18n_model', + 'mptt', + 'dpaste', + + # Own apps + 'super_archives', + 'api', + 'rss', + 'planet', + 'search', + 'badger', + 'tz', + + # Feedzilla and deps + 'feedzilla', + 'taggit', + 'common', ) MIDDLEWARE_CLASSES = ( @@ -43,6 +75,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) @@ -51,19 +84,8 @@ ROOT_URLCONF = 'colab.urls' WSGI_APPLICATION = 'colab.wsgi.application' - -# Database -# https://docs.djangoproject.com/en/dev/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - # Internationalization -# https://docs.djangoproject.com/en/dev/topics/i18n/ +# https://docs.djangoproject.com/en/1.7/topics/i18n/ LANGUAGE_CODE = 'en-us' @@ -77,9 +99,217 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/dev/howto/static-files/ +# https://docs.djangoproject.com/en/1.7/howto/static-files/ + +STATIC_ROOT = '/usr/share/nginx/colab/static/' +MEDIA_ROOT = '/usr/share/nginx/colab/media/' STATIC_URL = '/static/' MEDIA_URL = '/media/' -from custom_settings import * + +# Normally you should not import ANYTHING from Django directly +# into your settings, but ImproperlyConfigured is an exception. +from django.core.exceptions import ImproperlyConfigured + + +def get_env_setting(setting): + """ Get the environment setting or return exception """ + try: + return os.environ[setting] + except KeyError: + error_msg = "Set the %s env variable" % setting + raise ImproperlyConfigured(error_msg) + + +# Allow Django runserver to serve SVG files +# https://code.djangoproject.com/ticket/20162 +import mimetypes +mimetypes.add_type('image/svg+xml', '.svg') + +LANGUAGES = ( + ('en', _('English')), + ('pt-br', _('Portuguese')), + ('es', _('Spanish')), +) + +DJANGO_DATE_FORMAT_TO_JS = { + 'pt-br': ('pt-BR', 'dd/MM/yyyy'), + 'es': ('es', 'dd/MM/yyyy'), +} + +LANGUAGE_CODE = 'en' + +# The absolute path to the folder containing the attachments +ATTACHMENTS_FOLDER_PATH = '/mnt/trac/attachments/' + +# ORDERING_DATA receives the options to order for as it's keys and a dict as +# value, if you want to order for the last name, you can use something like: +# 'last_name': {'name': 'Last Name', 'fields': 'last_name'} inside the dict, +# you pass two major keys (name, fields) +# The major key name is the name to appear on the template +# the major key fields it show receive the name of the fields to order for in +# the indexes + +ORDERING_DATA = { + 'latest': { + 'name': _(u'Recent activity'), + 'fields': ('-modified', '-created'), + }, + 'hottest': { + 'name': _(u'Relevance'), + 'fields': None, + }, +} + + +# File type groupings is a tuple of tuples containg what it should filter, +# how it should be displayed, and a tuple of which mimetypes it includes +FILE_TYPE_GROUPINGS = ( + ('document', _(u'Document'), + ('doc', 'docx', 'odt', 'otx', 'dotx', 'pdf', 'ott')), + ('presentation', _(u'Presentation'), ('ppt', 'pptx', 'odp')), + ('text', _(u'Text'), ('txt', 'po', 'conf', 'log')), + ('code', _(u'Code'), + ('py', 'php', 'js', 'sql', 'sh', 'patch', 'diff', 'html', '')), + ('compressed', _(u'Compressed'), ('rar', 'zip', 'gz', 'tgz', 'bz2')), + ('image', _(u'Image'), + ('jpg', 'jpeg', 'png', 'tiff', 'gif', 'svg', 'psd', 'planner', 'cdr')), + ('spreadsheet', _(u'Spreadsheet'), + ('ods', 'xls', 'xlsx', 'xslt', 'csv')), +) + +# the following variable define how many characters should be shown before +# a highlighted word, to make sure that the highlighted word will appear +HIGHLIGHT_NUM_CHARS_BEFORE_MATCH = 30 +HAYSTACK_CUSTOM_HIGHLIGHTER = 'colab.utils.highlighting.ColabHighlighter' + +HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', + 'URL': 'http://localhost:8983/solr/', + } +} + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': '127.0.0.1:11211', + } +} + +DATABASE_ROUTERS = [] + + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'django.core.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + 'django.core.context_processors.request', + 'django_mobile.context_processors.is_mobile', + 'super_archives.context_processors.mailarchive', + 'proxy.context_processors.proxied_apps', + 'home.context_processors.robots', +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django_mobile.middleware.MobileDetectionMiddleware', + 'django_mobile.middleware.SetFlavourMiddleware', + 'tz.middleware.TimezoneMiddleware', +) + +# Add the django_browserid authentication backend. +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', + 'accounts.auth.ColabBrowserIDBackend', +) + +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, 'static'), +) + +TEMPLATE_DIRS = ( + os.path.join(BASE_DIR, 'templates'), +) + +LOCALE_PATHS = ( + os.path.join(BASE_DIR, 'locale'), +) + +AUTH_USER_MODEL = 'accounts.User' + +from django.contrib.messages import constants as messages +MESSAGE_TAGS = { + messages.INFO: 'alert-info', + messages.SUCCESS: 'alert-success', + messages.WARNING: 'alert-warning', + messages.ERROR: 'alert-danger', +} + +### Feedzilla (planet) +from feedzilla.settings import * +FEEDZILLA_PAGE_SIZE = 5 +FEEDZILLA_SITE_TITLE = _(u'Planet Colab') +FEEDZILLA_SITE_DESCRIPTION = _(u'Colab blog aggregator') + +### Mailman API settings +MAILMAN_API_URL = 'http://localhost:9000' + +### BrowserID / Persona +SITE_URL = 'localhost:8000' +BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')] + + +LOGIN_URL = '/' +LOGIN_REDIRECT_URL = '/' +LOGIN_REDIRECT_URL_FAILURE = '/' +LOGOUT_REDIRECT_URL = '/user/logout' +BROWSERID_CREATE_USER = False + +REVPROXY_ADD_REMOTE_USER = True + +## Converse.js settings +# This URL must use SSL in order to keep chat sessions secure +CONVERSEJS_BOSH_SERVICE_URL = SITE_URL + '/http-bind' + +CONVERSEJS_ALLOW_CONTACT_REQUESTS = False +CONVERSEJS_SHOW_ONLY_ONLINE_USERS = True + + +# Tastypie settings +TASTYPIE_DEFAULT_FORMATS = ['json', ] + +# Dpaste settings +DPASTE_EXPIRE_CHOICES = ( + ('onetime', _(u'One Time Snippet')), + (3600, _(u'In one hour')), + (3600 * 24 * 7, _(u'In one week')), + (3600 * 24 * 30, _(u'In one month')), + ('never', _(u'Never')), +) +DPASTE_EXPIRE_DEFAULT = DPASTE_EXPIRE_CHOICES[4][0] +DPASTE_DEFAULT_GIST_DESCRIPTION = 'Gist created from Colab DPaste' +DPASTE_DEFAULT_GIST_NAME = 'colab_paste' +DPASTE_LEXER_DEFAULT = 'text' + +from .utils.conf import load_yaml_settings +locals().update(load_yaml_settings()) + +if RAVEN_DSN: + RAVEN_CONFIG = { + 'dsn': RAVEN_DSN + '?timeout=30', + } + +for app_label in PROXIED_APPS.keys(): + INSTALLED_APPS += ('proxy.{}'.format(app_label),) -- libgit2 0.21.2