Split the dashboard into different apps, add tests
[pharos.git] / tools / pharos-dashboard / pharos_dashboard / settings.py
1 """
2 Django settings for pharos_dashboard project.
3
4 Generated by 'django-admin startproject' using Django 1.10.
5
6 For more information on this file, see
7 https://docs.djangoproject.com/en/1.10/topics/settings/
8
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/1.10/ref/settings/
11 """
12
13 import os
14
15 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19 # Quick-start development settings - unsuitable for production
20 # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
21
22 # SECURITY WARNING: keep the secret key used in production secret!
23 SECRET_KEY = 'j*mq-lt&^*9e$%4mtc)f2$_i(wky#g@ycl3@&$^5n89a3^i)7i'
24
25 # SECURITY WARNING: don't run with debug turned on in production!
26 DEBUG = True
27
28 ALLOWED_HOSTS = []
29
30
31 # Application definition
32
33 INSTALLED_APPS = [
34     'dashboard',
35     'booking',
36     'account',
37     'jenkins',
38     'django.contrib.admin',
39     'django.contrib.auth',
40     'django.contrib.contenttypes',
41     'django.contrib.sessions',
42     'django.contrib.messages',
43     'django.contrib.staticfiles',
44     'django.contrib.humanize',
45     'bootstrap3',
46 ]
47
48 MIDDLEWARE = [
49     'django.middleware.security.SecurityMiddleware',
50     'django.contrib.sessions.middleware.SessionMiddleware',
51     'django.middleware.common.CommonMiddleware',
52     'django.middleware.csrf.CsrfViewMiddleware',
53     'django.contrib.auth.middleware.AuthenticationMiddleware',
54     'django.contrib.messages.middleware.MessageMiddleware',
55     'django.middleware.clickjacking.XFrameOptionsMiddleware',
56     'account.middleware.TimezoneMiddleware',
57 ]
58
59 ROOT_URLCONF = 'pharos_dashboard.urls'
60
61 TEMPLATES = [
62     {
63         'BACKEND': 'django.template.backends.django.DjangoTemplates',
64         'DIRS': [os.path.join(BASE_DIR, 'templates')]
65         ,
66         'APP_DIRS': True,
67         'OPTIONS': {
68             'context_processors': [
69                 'django.template.context_processors.debug',
70                 'django.template.context_processors.request',
71                 'django.contrib.auth.context_processors.auth',
72                 'django.contrib.messages.context_processors.messages',
73             ],
74         },
75     },
76 ]
77
78 WSGI_APPLICATION = 'pharos_dashboard.wsgi.application'
79
80
81 # Database
82 # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
83
84 DATABASES = {
85     'default': {
86         'ENGINE': 'django.db.backends.postgresql',
87         'NAME': 'pharos_dashboard',
88         'USER': 'opnfv',
89         'PASSWORD': 'opnfvopnfv',
90         'HOST': 'localhost',
91         'PORT': '',
92     }
93 }
94
95
96 # Password validation
97 # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
98
99 AUTH_PASSWORD_VALIDATORS = [
100     {
101         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
102     },
103     {
104         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
105     },
106     {
107         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
108     },
109     {
110         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
111     },
112 ]
113
114 # Internationalization
115 # https://docs.djangoproject.com/en/1.10/topics/i18n/
116
117 LANGUAGE_CODE = 'en-us'
118
119 TIME_ZONE = 'UTC'
120
121 USE_I18N = True
122
123 USE_L10N = True
124
125 USE_TZ = True
126
127
128 # Static files (CSS, JavaScript, Images)
129 # https://docs.djangoproject.com/en/1.10/howto/static-files/
130
131 STATIC_URL = '/static/'
132
133 STATICFILES_DIRS = [
134     os.path.join(BASE_DIR, "static"),
135 ]
136
137 BOOTSTRAP3 = {
138     'set_placeholder': False,
139 }
140
141 LOGIN_REDIRECT_URL = '/'