-
Notifications
You must be signed in to change notification settings - Fork 7
/
settings.py
51 lines (47 loc) · 1.73 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
from django.conf import settings
def configure_settings():
if not settings.configured:
# Determine the database settings depending on if a test_db var is set in CI mode or not
test_db = os.environ.get('DB', None)
if test_db is None:
db_config = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'ambition_dev',
'USER': 'ambition_dev',
'PASSWORD': 'ambition_dev',
'HOST': 'localhost'
}
elif test_db == 'postgres':
db_config = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'NAME': 'user_guide',
}
else:
raise RuntimeError('Unsupported test DB {0}'.format(test_db))
settings.configure(
DATABASES={
'default': db_config,
},
MIDDLEWARE_CLASSES=(
'django.middleware.csrf.CsrfViewMiddleware',
),
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'user_guide',
'user_guide.tests',
),
ROOT_URLCONF='user_guide.urls',
DEBUG=False,
USER_GUIDE_SHOW_MAX=5,
USER_GUIDE_CSS_URL='custom-style.css',
USER_GUIDE_JS_URL='custom-script.js',
STATIC_URL='/static/',
SECRET_KEY='somethignmadeup',
TEST_RUNNER='django_nose.NoseTestSuiteRunner',
NOSE_ARGS=['--nocapture', '--nologcapture', '--verbosity=1'],
)