Skip to content

Commit

Permalink
Split the settings: base and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
pikhovkin committed Sep 19, 2023
1 parent 7e26bde commit 0a5ae57
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [test]
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: tests.conf.settings.demo
steps:
- uses: actions/checkout@v3
- name: Docker login
Expand Down
10 changes: 2 additions & 8 deletions tests/conf/settings.py → tests/conf/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,10 @@
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DB_DIR = BASE_DIR.parent / 'data' / 'db'
DB_DIR.mkdir(parents=False, exist_ok=True)
DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': ':memory:',
# },
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': DB_DIR / 'db.sqlite3',
'NAME': ':memory:',
},
}

Expand Down Expand Up @@ -112,7 +106,7 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_ROOT = BASE_DIR.parent / 'data' / 'static'
STATIC_ROOT = BASE_DIR / 'static'
STATIC_URL = '/static/'

# Default primary key field type
Expand Down
20 changes: 20 additions & 0 deletions tests/conf/settings/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from . import *


# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DB_DIR = BASE_DIR.parent / 'data' / 'db'
DB_DIR.mkdir(parents=False, exist_ok=True)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': DB_DIR / 'db.sqlite3',
},
}

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_ROOT = BASE_DIR.parent / 'data' / 'static'
STATIC_URL = '/static/'

0 comments on commit 0a5ae57

Please sign in to comment.