1 # Copyright (c) 2017 Wind River Systems, Inc.
2 # Copyright (c) 2017-2018 VMware, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 from logging import config
16 from onaplogging import monkey
19 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
20 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
22 # Quick-start development settings - unsuitable for production
23 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
25 # SECURITY WARNING: keep the secret key used in production secret!
26 SECRET_KEY = '3o-wney!99y)^h3v)0$j16l9=fdjxcb+a8g+q3tfbahcnu2b0o'
28 # SECURITY WARNING: don't run with debug turned on in production!
33 # Application definition
36 'django.contrib.auth',
37 'django.contrib.contenttypes',
38 'django.contrib.sessions',
39 'django.contrib.messages',
40 'django.contrib.staticfiles',
42 'multivimbroker.pub.database',
45 MIDDLEWARE_CLASSES = [
46 'django.middleware.security.SecurityMiddleware',
47 'django.contrib.sessions.middleware.SessionMiddleware',
48 'django.middleware.common.CommonMiddleware',
49 'django.middleware.csrf.CsrfViewMiddleware',
50 'django.contrib.auth.middleware.AuthenticationMiddleware',
51 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
52 'django.contrib.messages.middleware.MessageMiddleware',
53 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54 'multivimbroker.middleware.LogContextMiddleware',
57 ROOT_URLCONF = 'multivimbroker.urls'
59 WSGI_APPLICATION = 'multivimbroker.wsgi.application'
62 'DEFAULT_RENDERER_CLASSES': (
63 'rest_framework.renderers.JSONRenderer',
66 'DEFAULT_PARSER_CLASSES': (
67 'rest_framework.parsers.JSONParser',
68 'rest_framework.parsers.MultiPartParser',
69 # 'rest_framework.parsers.FormParser',
70 # 'rest_framework.parsers.FileUploadParser',
75 # CACHE_BACKEND = 'redis_cache.cache://%s@%s:%s' %
76 # (REDIS_PASSWD, REDIS_HOST, REDIS_PORT)
80 # Static files (CSS, JavaScript, Images)
81 # https://docs.djangoproject.com/en/1.6/howto/static-files/
83 STATIC_URL = '/static/'
87 # yaml configuration of logging
88 LOGGING_FILE = os.path.join(BASE_DIR, 'multivimbroker/pub/config/log.yml')
89 config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
92 if 'test' in sys.argv:
93 from multivimbroker.pub.config import config
97 if platform.system() == 'Linux':
98 TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
99 TEST_OUTPUT_VERBOSE = True
100 TEST_OUTPUT_DESCRIPTIONS = True
101 TEST_OUTPUT_DIR = 'test-reports'