django-orchestra-test/orchestra/conf/base_settings.py

256 lines
8.1 KiB
Python
Raw Normal View History

2014-05-08 16:59:35 +00:00
# Django settings for orchestra project.
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# Enable persistent connections
CONN_MAX_AGE = 60*10
# 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.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'UTC'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
2014-07-29 20:10:37 +00:00
MEDIA_URL = '/media/'
2014-05-08 16:59:35 +00:00
ALLOWED_HOSTS = '*'
# Set this to True to wrap each HTTP request in a transaction on this database.
ATOMIC_REQUESTS = True
2014-05-08 16:59:35 +00:00
MIDDLEWARE_CLASSES = (
'django.middleware.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
2014-09-26 15:05:20 +00:00
'orchestra.core.caches.RequestCacheMiddleware',
2014-05-08 16:59:35 +00:00
'orchestra.apps.orchestration.middlewares.OperationsMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
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.contrib.messages.context_processors.messages",
"django.core.context_processors.request",
"orchestra.core.context_processors.site",
)
INSTALLED_APPS = (
# django-orchestra apps
2014-11-12 12:45:37 +00:00
2014-05-08 16:59:35 +00:00
'orchestra',
2014-10-17 10:04:47 +00:00
'orchestra.apps.accounts',
'orchestra.apps.contacts',
2014-05-08 16:59:35 +00:00
'orchestra.apps.orchestration',
'orchestra.apps.domains',
'orchestra.apps.systemusers',
2014-10-17 10:04:47 +00:00
'orchestra.apps.mailboxes',
2014-05-08 16:59:35 +00:00
'orchestra.apps.lists',
'orchestra.apps.webapps',
'orchestra.apps.websites',
'orchestra.apps.databases',
'orchestra.apps.vps',
2014-09-26 19:21:09 +00:00
'orchestra.apps.saas',
2014-05-08 16:59:35 +00:00
'orchestra.apps.issues',
2014-09-17 10:32:29 +00:00
'orchestra.apps.services',
2014-11-18 13:59:21 +00:00
'orchestra.apps.plans',
2014-05-27 15:55:09 +00:00
'orchestra.apps.orders',
2014-07-16 15:20:16 +00:00
'orchestra.apps.miscellaneous',
2014-07-23 16:24:56 +00:00
'orchestra.apps.bills',
'orchestra.apps.payments',
2014-05-08 16:59:35 +00:00
# Third-party apps
'django_extensions',
'djcelery',
'djcelery_email',
'fluent_dashboard',
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
# 'admin_tools.dashboard',
2014-05-08 16:59:35 +00:00
'rest_framework',
'rest_framework.authtoken',
'passlib.ext.django',
# Django.contrib
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
2014-10-07 13:08:59 +00:00
'django.contrib.admin.apps.SimpleAdminConfig',
2014-05-08 16:59:35 +00:00
2014-10-17 10:04:47 +00:00
# Last to load
2014-07-08 15:19:15 +00:00
'orchestra.apps.resources',
2014-05-08 16:59:35 +00:00
)
AUTH_USER_MODEL = 'accounts.Account'
2014-05-08 16:59:35 +00:00
AUTHENTICATION_BACKENDS = [
'orchestra.permissions.auth.OrchestraPermissionBackend',
'django.contrib.auth.backends.ModelBackend',
]
2014-11-27 19:17:26 +00:00
# Email config
EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
2014-05-08 16:59:35 +00:00
#################################
## 3RD PARTY APPS CONIGURATION ##
#################################
# Admin Tools
ADMIN_TOOLS_MENU = 'orchestra.admin.menu.OrchestraMenu'
# Fluent dashboard
# TODO subclass like in admin_tools_menu
ADMIN_TOOLS_INDEX_DASHBOARD = 'fluent_dashboard.dashboard.FluentIndexDashboard'
FLUENT_DASHBOARD_ICON_THEME = '../orchestra/icons'
FLUENT_DASHBOARD_APP_GROUPS = (
# Services group is generated by orchestra.admin.dashboard
('Accounts', {
'models': (
'orchestra.apps.accounts.models.Account',
'orchestra.apps.contacts.models.Contact',
2014-05-27 15:55:09 +00:00
'orchestra.apps.orders.models.Order',
2014-11-18 13:59:21 +00:00
'orchestra.apps.plans.models.ContractedPlan',
2014-07-23 16:24:56 +00:00
'orchestra.apps.bills.models.Bill',
# 'orchestra.apps.payments.models.PaymentSource',
2014-07-23 16:24:56 +00:00
'orchestra.apps.payments.models.Transaction',
# 'orchestra.apps.payments.models.TransactionProcess',
2014-07-23 18:28:40 +00:00
'orchestra.apps.issues.models.Ticket',
2014-05-08 16:59:35 +00:00
),
'collapsible': True,
}),
('Administration', {
'models': (
'djcelery.models.TaskState',
'orchestra.apps.orchestration.models.Route',
'orchestra.apps.orchestration.models.BackendLog',
'orchestra.apps.orchestration.models.Server',
2014-07-08 15:19:15 +00:00
'orchestra.apps.resources.models.Resource',
2014-11-20 15:34:59 +00:00
'orchestra.apps.resources.models.ResourceData',
2014-09-17 10:32:29 +00:00
'orchestra.apps.services.models.Service',
2014-11-18 13:59:21 +00:00
'orchestra.apps.plans.models.Plan',
2014-11-13 15:34:00 +00:00
'orchestra.apps.miscellaneous.models.MiscService',
2014-05-08 16:59:35 +00:00
),
'collapsible': True,
}),
)
FLUENT_DASHBOARD_APP_ICONS = {
# Services
'webs/web': 'web.png',
'mail/address': 'X-office-address-book.png',
2014-10-17 10:04:47 +00:00
'mailboxes/mailbox': 'email.png',
'mailboxes/address': 'X-office-address-book.png',
2014-05-08 16:59:35 +00:00
'lists/list': 'email-alter.png',
'domains/domain': 'domain.png',
'multitenance/tenant': 'apps.png',
'webapps/webapp': 'Applications-other.png',
'websites/website': 'Applications-internet.png',
'databases/database': 'database.png',
'databases/databaseuser': 'postgresql.png',
'vps/vps': 'TuxBox.png',
2014-07-23 16:24:56 +00:00
'miscellaneous/miscellaneous': 'applications-other.png',
2014-09-26 19:21:09 +00:00
'saas/saas': 'saas.png',
'systemusers/systemuser': 'roleplaying.png',
2014-05-08 16:59:35 +00:00
# Accounts
'accounts/account': 'Face-monkey.png',
2014-07-24 09:53:34 +00:00
'contacts/contact': 'contact_book.png',
2014-05-27 16:07:57 +00:00
'orders/order': 'basket.png',
2014-11-18 13:59:21 +00:00
'plans/contractedplan': 'ContractedPack.png',
2014-09-17 10:32:29 +00:00
'services/service': 'price.png',
2014-07-23 16:24:56 +00:00
'bills/bill': 'invoice.png',
'payments/paymentsource': 'card_in_use.png',
2014-07-23 16:24:56 +00:00
'payments/transaction': 'transaction.png',
'payments/transactionprocess': 'transactionprocess.png',
2014-07-23 18:28:40 +00:00
'issues/ticket': 'Ticket_star.png',
2014-11-13 15:34:00 +00:00
'miscellaneous/miscservice': 'Misc-Misc-Box-icon.png',
2014-05-08 16:59:35 +00:00
# Administration
'djcelery/taskstate': 'taskstate.png',
'orchestration/server': 'vps.png',
'orchestration/route': 'hal.png',
'orchestration/backendlog': 'scriptlog.png',
2014-07-08 15:19:15 +00:00
'resources/resource': "gauge.png",
2014-11-20 15:34:59 +00:00
'resources/resourcedata': "monitor.png",
2014-11-18 13:59:21 +00:00
'plans/plan': 'Pack.png',
2014-05-08 16:59:35 +00:00
}
# Django-celery
import djcelery
djcelery.setup_loader()
# Broker
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_SEND_EVENTS = True
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
CELERY_DISABLE_RATE_LIMITS = True
# Do not fill the logs with crap
CELERY_REDIRECT_STDOUTS_LEVEL = 'DEBUG'
# rest_framework
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'orchestra.permissions.api.OrchestraPermissionBackend',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_FILTER_BACKENDS': (
('rest_framework.filters.DjangoFilterBackend',)
),
}
# Use a UNIX compatible hash
PASSLIB_CONFIG = (
"[passlib]\n"
"schemes = sha512_crypt, django_pbkdf2_sha256, django_pbkdf2_sha1,"
" django_bcrypt, django_bcrypt_sha256, django_salted_sha1, des_crypt,"
" django_salted_md5, django_des_crypt, hex_md5, bcrypt, phpass\n"
"default = sha512_crypt\n"
"deprecated = django_pbkdf2_sha1, django_salted_sha1, django_salted_md5,"
" django_des_crypt, des_crypt, hex_md5\n"
"all__vary_rounds = 0.05\n"
"django_pbkdf2_sha256__min_rounds = 10000\n"
"sha512_crypt__min_rounds = 80000\n"
"staff__django_pbkdf2_sha256__default_rounds = 12500\n"
"staff__sha512_crypt__default_rounds = 100000\n"
"superuser__django_pbkdf2_sha256__default_rounds = 15000\n"
"superuser__sha512_crypt__default_rounds = 120000\n"
)