added coverage dependency; 99 percent test coverage (only lacking admin, currently by design); commenced postgresql db integration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/6.0/ref/settings/
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
import dj_database_url
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
@@ -26,13 +27,11 @@ if 'DJANGO_DEBUG_FALSE' in os.environ:
|
||||
DEBUG = False
|
||||
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
|
||||
ALLOWED_HOSTS = [host.strip() for host in os.environ['DJANGO_ALLOWED_HOST'].split(',')]
|
||||
db_path = os.environ['DJANGO_DB_PATH']
|
||||
else:
|
||||
DEBUG = True
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-&9b_h=qpjy=sshhnsyg98&jp7(t6*v78__y%h2l$b#_@6z$-9r'
|
||||
ALLOWED_HOSTS = []
|
||||
db_path = BASE_DIR / 'db.sqlite3'
|
||||
|
||||
|
||||
# Application definition
|
||||
@@ -90,12 +89,16 @@ ASGI_APPLICATION = 'core.asgi.application'
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': db_path,
|
||||
DATABASE_URL = os.environ.get('DATABASE_URL')
|
||||
if DATABASE_URL:
|
||||
DATABASES = {'default': dj_database_url.config(conn_max_age=600)}
|
||||
else:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
|
||||
Reference in New Issue
Block a user