142 lines
4.0 KiB
Python
Raw Normal View History

2011-07-03 21:10:53 -07:00
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
2011-09-19 14:51:10 -07:00
# Copyright 2011 Nebula, Inc.
2011-07-03 21:10:53 -07:00
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
2011-01-12 13:43:31 -08:00
import logging
import os
import sys
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(ROOT_PATH)
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_ID = 1
2011-01-31 13:12:52 -08:00
SITE_BRANDING = 'OpenStack'
SITE_NAME = 'openstack'
ENABLE_VNC = True
2011-01-12 13:43:31 -08:00
2011-06-20 10:21:01 -07:00
LOGIN_URL = '/auth/login'
2011-01-12 13:43:31 -08:00
LOGIN_REDIRECT_URL = '/'
MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))
2011-01-12 13:43:31 -08:00
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
2011-01-12 13:43:31 -08:00
CREDENTIAL_AUTHORIZATION_DAYS = '5'
ROOT_URLCONF = 'dashboard.urls'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'dashboard.middleware.DashboardLogUnhandledExceptionsMiddleware',
'horizon.middleware.HorizonMiddleware',
2011-01-12 13:43:31 -08:00
'django.middleware.doc.XViewMiddleware',
2011-06-03 14:23:25 +09:00
'django.middleware.locale.LocaleMiddleware',
2011-01-12 13:43:31 -08:00
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static',
2011-01-12 13:43:31 -08:00
'django.contrib.messages.context_processors.messages',
'horizon.context_processors.horizon',
2011-01-12 13:43:31 -08:00
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
TEMPLATE_DIRS = (
os.path.join(ROOT_PATH, 'templates'),
)
STATICFILES_DIRS = (
os.path.join(ROOT_PATH, 'static'),
)
2011-01-12 13:43:31 -08:00
INSTALLED_APPS = (
'dashboard',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_nose',
'horizon',
'horizon.dashboards.nova',
'horizon.dashboards.syspanel',
'horizon.dashboards.settings',
2011-01-12 13:43:31 -08:00
)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
2011-01-12 13:43:31 -08:00
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
2011-01-12 13:43:31 -08:00
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
TIME_ZONE = None
2011-06-03 14:23:25 +09:00
gettext_noop = lambda s: s
LANGUAGES = (
('en', gettext_noop('English')),
2011-08-09 16:22:16 +02:00
('it', gettext_noop('Italiano')),
2011-06-03 14:23:25 +09:00
('es', gettext_noop('Spanish')),
('fr', gettext_noop('French')),
('ja', gettext_noop('Japanese')),
('pt', gettext_noop('Portuguese')),
('pl', gettext_noop('Polish')),
2011-06-03 14:23:25 +09:00
('zh-cn', gettext_noop('Simplified Chinese')),
('zh-tw', gettext_noop('Traditional Chinese')),
)
LANGUAGE_CODE = 'en'
USE_I18N = True
2011-01-12 13:43:31 -08:00
ACCOUNT_ACTIVATION_DAYS = 7
TOTAL_CLOUD_RAM_GB = 10
2011-01-15 01:05:54 -08:00
OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'Member'
LIVE_SERVER_PORT = 8000
2011-01-12 13:43:31 -08:00
try:
from local.local_settings import *
except Exception, e:
logging.exception(e)
if DEBUG:
logging.basicConfig(level=logging.DEBUG)
2011-07-15 00:37:02 -07:00
try:
import debug_toolbar
INSTALLED_APPS += ('debug_toolbar',)
2011-09-12 10:28:12 -07:00
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',)
2011-07-15 00:37:02 -07:00
except ImportError:
_logger = logging.getLogger(__name__)
_logger.debug('Running in debug mode without debug_toolbar.')