Skip to content

Commit

Permalink
debug console by default
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Jan 24, 2024
1 parent df259d2 commit 782eef8
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 163 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci_assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
export DB_NAME_TEST="test_$DB_NAME"
if [ ${GITHUB_REF##*/} = "develop" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
if [ ${GITHUB_REF##*/} = "main" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
echo "Branch ${GITHUB_REF##*/}, usign ${DBBRANCH} branch for database"
git clone --depth=1 --branch=$DBBRANCH https://github.com/openimis/database_postgresql.git ./sql_psql
Expand All @@ -108,7 +108,7 @@ jobs:
run: |
export DB_NAME_TEST="test_$DB_NAME"
if [ ${GITHUB_REF##*/} = "develop" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
if [ ${GITHUB_REF##*/} = "main" ]; then export DBBRANCH="main"; else export DBBRANCH="develop"; fi
echo "Branch ${GITHUB_REF##*/}, usign ${DBBRANCH} branch for database"
git clone --depth=1 --branch=$DBBRANCH https://github.com/openimis/database_ms_sqlserver.git ./sql_mssql
cd sql_mssql/ && bash concatenate_files.sh && cd ..
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
python -V
export MODULES=$(jq -r '(.modules[].name)' ../openimis.json | xargs)
echo $MODULES
python manage.py test --keepdb $MODULES
python manage.py test --timing --debug-mode $MODULES
env:
SECRET_KEY: secret
DEBUG: true
Expand All @@ -162,7 +162,7 @@ jobs:
python -V
export MODULES=$(jq -r '(.modules[].name)' ../openimis.json | xargs)
echo $MODULES
python manage.py test --debug-mode --timing --keepdb $MODULES
python manage.py test --debug-mode --timing $MODULES
env:
SECRET_KEY: secret
DEBUG: true
Expand Down
51 changes: 51 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,56 @@

],
"configurations": [

{
"name": "pushpastMonth",
"type": "python",
"request": "launch",
"program": "./manage.py",
"args": [
"pushadx","2023-03-01","pushLastMonth","--verbose"
],
"django": true,
"cwd": "${workspaceRoot}/openIMIS",
"env": {
"DB_DEFAULT": "PSQL"
},
"purpose":["debug-in-terminal"],
"justMyCode": true
},

{
"name": "orgunit",
"type": "python",
"request": "launch",
"program": "./manage.py",
"args": [
"pushmetadata","2010-06-01","orgunit","--verbose"
],
"django": true,
"cwd": "${workspaceRoot}/openIMIS",
"env": {
"DB_DEFAULT": "PSQL"
},
"purpose":["debug-in-terminal"],
"justMyCode": true
},
{
"name": "pushMetadata",
"type": "python",
"request": "launch",
"program": "./manage.py",
"args": [
"pushadx","2023-06-01","pushMetadata","--verbose"
],
"django": true,
"cwd": "${workspaceRoot}/openIMIS",
"env": {
"DB_DEFAULT": "PSQL"
},
"purpose":["debug-in-terminal"],
"justMyCode": true
},
{
"name": "gen trad be",
"type": "python",
Expand All @@ -42,6 +92,7 @@
"purpose":["debug-in-terminal"],
"justMyCode": true
},

{
"name": "migrate",
"type": "python",
Expand Down
1 change: 0 additions & 1 deletion openIMIS/developer_tools/skeletons/openmis-module-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
python -V
ls -l
python manage.py migrate
python init_test_db.py | grep . | uniq -c
python manage.py test --keepdb $MODULE_NAME
env:
SECRET_KEY: secret
Expand Down
12 changes: 8 additions & 4 deletions openIMIS/openIMIS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

LOGGING_LEVEL = os.getenv("DJANGO_LOG_LEVEL", "WARNING")
DEFAULT_LOGGING_HANDLER = os.getenv("DJANGO_LOG_HANDLER", "debug-log")


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get("DEBUG", "False").lower() == "true"

LOGGING_LEVEL = os.getenv("DJANGO_LOG_LEVEL", "DEBUG" if DEBUG else "WARNING" )
DEFAULT_LOGGING_HANDLER = os.getenv("DJANGO_LOG_HANDLER", "console")

LOGGING = {
"version": 1,
Expand Down Expand Up @@ -123,8 +128,7 @@ def SITE_URL():
"SECRET_KEY", "chv^^7i_v3-04!rzu&qe#+h*a=%h(ib#5w9n$!f2q7%2$qp=zz"
)

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get("DEBUG", "False").lower() == "true"

# SECURITY WARNING: don't run without row security in production!
# Row security is dedicated to filter the data result sets according to users' right
# Example: user registered at a Health Facility should only see claims recorded for that Health Facility
Expand Down
Loading

0 comments on commit 782eef8

Please sign in to comment.