2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Improvements to development docker-compose script

- Python packages are installed in a virtual environment within the src dir
- This prevents a LONG installation process each time the docker image is rebuilt
This commit is contained in:
Oliver Walters
2021-05-12 20:53:50 +10:00
parent 914db9e913
commit 3381c5e257
4 changed files with 39 additions and 27 deletions

View File

@ -430,11 +430,15 @@ It can be specified in config.yaml (or envvar) as either (for example):
- django.db.backends.postgresql
"""
db_engine = db_config['ENGINE']
db_engine = db_config['ENGINE'].lower()
if db_engine.lower() in ['sqlite3', 'postgresql', 'mysql']:
# Correct common misspelling
if db_engine == 'sqlite':
db_engine = 'sqlite3'
if db_engine in ['sqlite3', 'postgresql', 'mysql']:
# Prepend the required python module string
db_engine = f'django.db.backends.{db_engine.lower()}'
db_engine = f'django.db.backends.{db_engine}'
db_config['ENGINE'] = db_engine
db_name = db_config['NAME']