hobo/hobo/default_settings.py

158 lines
3.9 KiB
Python

"""
Django settings for hobo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from django.conf import global_settings
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hc^g)m7+*n+!8ej5i4*5iiv21s-y#+lpgje1w8d1jw5cyd+g%s'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'gadjo',
'hobo.environment',
'hobo.agent',
)
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',
)
ROOT_URLCONF = 'hobo.urls'
WSGI_APPLICATION = 'hobo.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'hobo', 'templates'),
)
STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + ('gadjo.finders.XStaticFinder',)
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'hobo', 'static'),
)
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'hobo', 'locale'),
)
SERVICE_URL_TEMPLATE = 'https://${app}.example.net'
# SERVICE_TEMPLATES: possible "flavours" for the various service types.
# This variable expects a dictionary mapping service identifiers
# to a list of (template name, template title) tuples.
#
# Note: Template names are opaque identifiers, it's up to the deployment
# agents to assign some meaning to them.
#
# Example:
# SERVICE_TEMPLATES = {
# 'wcs': [('export-auquo-light.wcs', u'Au quotidien light'),
# ('export-auquo.wcs', u'Au quotidien'),
# ('export-demo.wcs', u'Au quotidien Demo')],
# }
SERVICE_TEMPLATES = None
# SERVICE_EXTRA_VARIABLES: variables to create automatically for the
# given service types.
#
# Example:
# SERVICE_EXTRA_VARIABLES = {
# 'wcs': ['legal_url', 'commune_url', 'domain_key'],
# }
SERVICE_EXTRA_VARIABLES = None
AGENT_HOST_PATTERNS = None
AGENT_WCS_COMMAND = '/usr/sbin/wcsctl check-hobos'
AGENT_AUTHENTIC_COMMAND = '/usr/bin/authentic2-ctl deploy'
try:
from kombu.common import Broadcast
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_QUEUES = (Broadcast('broadcast_tasks'), )
except ImportError:
pass
LOGIN_REDIRECT_URL = '/'
# mellon authentication params
MELLON_ATTRIBUTE_MAPPING = {
'username': '{attributes[username][0]}',
'email': '{attributes[email][0]}',
'first_name': '{attributes[first_name][0]}',
'last_name': '{attributes[last_name][0]}',
}
MELLON_SUPERUSER_MAPPING = {
'roles': 'Admin::Hobo',
}
MELLON_USERNAME_TEMPLATE = '{attributes[username][0]}'