diff --git a/jumpserver/settings.py b/jumpserver/settings.py index 6de95c9f4..0a881c323 100644 --- a/jumpserver/settings.py +++ b/jumpserver/settings.py @@ -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 = (