vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / multicloud_azure / settings.py
1 # Copyright (c) 2018 Amdocs
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
12
13 import os
14 import sys
15 from logging import config
16 from onaplogging import monkey
17 from aria import install_aria_extensions
18 monkey.patch_all()
19
20 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
21 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
22
23 # Quick-start development settings - unsuitable for production
24 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
25
26 # SECURITY WARNING: keep the secret key used in production secret!
27 SECRET_KEY = '3o-wney!99y)^h3v)0$j16l9=fdjxcb+a8g+q3tfbahcnu2b0o'
28
29 # SECURITY WARNING: don't run with debug turned on in production!
30 # DEBUG = True
31
32 ALLOWED_HOSTS = ['*']
33
34 # Application definition
35
36 INSTALLED_APPS = [
37     'django.contrib.auth',
38     'django.contrib.contenttypes',
39     'django.contrib.sessions',
40     'django.contrib.messages',
41     'django.contrib.staticfiles',
42     'rest_framework',
43     'multicloud_azure.pub.database',
44 ]
45
46 MIDDLEWARE_CLASSES = [
47     'django.middleware.security.SecurityMiddleware',
48     'django.contrib.sessions.middleware.SessionMiddleware',
49     'django.middleware.common.CommonMiddleware',
50     'django.middleware.csrf.CsrfViewMiddleware',
51     'django.contrib.auth.middleware.AuthenticationMiddleware',
52     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
53     'django.contrib.messages.middleware.MessageMiddleware',
54     'django.middleware.clickjacking.XFrameOptionsMiddleware',
55     'multicloud_azure.middleware.LogContextMiddleware',
56 ]
57
58 ROOT_URLCONF = 'multicloud_azure.urls'
59
60 WSGI_APPLICATION = 'multicloud_azure.wsgi.application'
61
62 REST_FRAMEWORK = {
63     'DEFAULT_RENDERER_CLASSES': (
64         'rest_framework.renderers.JSONRenderer',
65     ),
66
67     'DEFAULT_PARSER_CLASSES': (
68         'rest_framework.parsers.JSONParser',
69         'rest_framework.parsers.MultiPartParser',
70         # 'rest_framework.parsers.FormParser',
71         # 'rest_framework.parsers.FileUploadParser',
72     )
73 }
74
75
76 TIME_ZONE = 'UTC'
77
78 # Static files (CSS, JavaScript, Images)
79 # https://docs.djangoproject.com/en/1.6/howto/static-files/
80
81 STATIC_URL = '/static/'
82
83
84 LOGGING_CONFIG = None
85 # yaml configuration of logging
86 LOGGING_FILE = os.path.join(BASE_DIR, 'multicloud_azure/pub/config/log.yml')
87 config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
88
89
90 if 'test' in sys.argv:
91     from multicloud_azure.pub.config import config
92     REST_FRAMEWORK = {}
93     import platform
94
95     if platform.system() == 'Linux':
96         TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
97         TEST_OUTPUT_VERBOSE = True
98         TEST_OUTPUT_DESCRIPTIONS = True
99         TEST_OUTPUT_DIR = 'test-reports'
100
101 install_aria_extensions()