Update settings.py

pull/256/head
ibuler 2016-06-07 16:17:10 +08:00
parent 6a7d105484
commit e608fbaad5
1 changed files with 10 additions and 3 deletions

View File

@ -99,7 +99,7 @@ WSGI_APPLICATION = 'jumpserver.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {}
if config.get('db', 'use_mysql') == 'true':
if config.get('db', 'engine') == 'mysql':
DB_HOST = config.get('db', 'host')
DB_PORT = config.getint('db', 'port')
DB_USER = config.get('db', 'user')
@ -115,11 +115,18 @@ if config.get('db', 'use_mysql') == 'true':
'PORT': DB_PORT,
}
}
else:
elif config.get('db', 'engine') == 'sqlite':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': config.get('db', 'sqlite3_path'),
'NAME': config.get('db', 'database'),
}
}
else
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
TEMPLATE_CONTEXT_PROCESSORS = (