import logging import os import sys from openstack_dashboard import exceptions ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin')) if ROOT_PATH not in sys.path: sys.path.append(ROOT_PATH) DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.abspath(os.path.join(ROOT_PATH, 'dashboard.sqlite')) } } SITE_BRANDING = 'OpenStack Dashboard' LOGIN_URL = '/auth/login/' LOGOUT_URL = '/auth/logout/' # LOGIN_REDIRECT_URL can be used as an alternative for # HORIZON_CONFIG.user_home, if user_home is not set. # Do not set it to '/home/', as this will cause circular redirect loop LOGIN_REDIRECT_URL = '/' MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media')) MEDIA_URL = '/media/' STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static')) STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/' ROOT_URLCONF = 'openstack_dashboard.urls' HORIZON_CONFIG = { 'dashboards': ('project', 'admin', 'settings', 'murano'), 'default_dashboard': 'murano', 'user_home': 'muranodashboard.views.get_user_home', 'ajax_queue_limit': 10, 'auto_fade_alerts': { 'delay': 3000, 'fade_duration': 1500, 'types': ['alert-success', 'alert-info'] }, 'help_url': "http://docs.openstack.org", 'exceptions': {'recoverable': exceptions.RECOVERABLE, 'not_found': exceptions.NOT_FOUND, 'unauthorized': exceptions.UNAUTHORIZED}, } MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'muranodashboard.middleware.ExceptionMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.middleware.locale.LocaleMiddleware', ) 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', 'django.contrib.messages.context_processors.messages', 'horizon.context_processors.horizon', 'openstack_dashboard.context_processors.openstack' ) TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'horizon.loaders.TemplateLoader', ) TEMPLATE_DIRS = ( os.path.join(ROOT_PATH, 'templates'), ) STATICFILES_FINDERS = ( 'compressor.finders.CompressorFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) less_binary = os.path.join(BIN_DIR, 'less', 'lessc') COMPRESS_PRECOMPILERS = ( ('text/less', (less_binary + ' {infile} {outfile}')), ) COMPRESS_CSS_FILTERS = ( 'compressor.filters.css_default.CssAbsoluteFilter', ) COMPRESS_ENABLED = True COMPRESS_OUTPUT_DIR = 'muranodashboard' COMPRESS_CSS_HASHING_METHOD = 'hash' COMPRESS_PARSER = 'compressor.parser.HtmlParser' INSTALLED_APPS = ( 'openstack_dashboard', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'compressor', 'horizon', 'openstack_dashboard.dashboards.project', 'openstack_dashboard.dashboards.admin', 'openstack_dashboard.dashboards.settings', 'openstack_auth', 'floppyforms', 'muranodashboard' ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' AUTHENTICATION_BACKENDS = ('openstack_auth.backend.KeystoneBackend',) MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies' SESSION_COOKIE_HTTPONLY = True SESSION_EXPIRE_AT_BROWSER_CLOSE = True SESSION_COOKIE_SECURE = False gettext_noop = lambda s: s LANGUAGES = ( ('en', gettext_noop('English')), ('it', gettext_noop('Italiano')), ('es', gettext_noop('Spanish')), ('fr', gettext_noop('French')), ('ja', gettext_noop('Japanese')), ('pt', gettext_noop('Portuguese')), ('pl', gettext_noop('Polish')), ('zh-cn', gettext_noop('Simplified Chinese')), ('zh-tw', gettext_noop('Traditional Chinese')), ) LANGUAGE_CODE = 'en' USE_I18N = True USE_L10N = True USE_TZ = True OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'Member' DEFAULT_EXCEPTION_REPORTER_FILTER = 'horizon.exceptions.HorizonReporterFilter' try: from local.local_settings import * except ImportError: logging.warning("No local_settings file found.") if DEBUG: logging.basicConfig(level=logging.DEBUG)