add testdata to docker setup. use sqlite in 'dev' scenario and mailpit in 'testing'
All checks were successful
/ test (push) Successful in 2m44s
/ deploy (push) Successful in 3m33s

This commit is contained in:
j3d1 2024-12-22 21:00:28 +01:00
parent c512da2660
commit ed7186cbbd
5 changed files with 126 additions and 34 deletions

View file

@ -124,19 +124,12 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'core.wsgi.application'
ASGI_APPLICATION = 'core.asgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
if 'test' in sys.argv:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
else:
if os.getenv('DB_HOST') is not None:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
@ -149,6 +142,20 @@ else:
'charset': 'utf8mb4',
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
}
},
}
elif os.getenv('DB_FILE') is not None:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.getenv('DB_FILE', 'local.db'),
}
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}