Skip to content

Commit

Permalink
Merge pull request #924 from UW-GAC/feature/add-django-check-to-ci
Browse files Browse the repository at this point in the history
Add django db check to ci
  • Loading branch information
jmcarson authored Feb 7, 2025
2 parents f438a3e + 3924695 commit bebb991
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
- name: Collect staticfiles
run: python manage.py collectstatic --noinput --settings=config.settings.test

- name: Run Django DB config check
run: python manage.py check --database default --fail-level WARNING --settings=config.settings.test

- name: Run tests
run: |
pytest --cov=gregor_django -n auto
Expand Down
6 changes: 6 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@
"root": {"level": "DEBUG", "handlers": ["console"]},
}

# Django silence system check warnings. https://docs.djangoproject.com/en/5.1/ref/checks/#security
# This check is regarding constraints placed by django-allauth
# that mysql does not support. https://github.com/pennersr/django-allauth/issues/3385
# we would need to move to postgres to support this type of constraint with filter
SILENCED_SYSTEM_CHECKS = ["models.W036"]

# django-maintenance-mode
MAINTENANCE_MODE_IGNORE_SUPERUSER = True
MAINTENANCE_MODE_IGNORE_TESTS = True
Expand Down
4 changes: 2 additions & 2 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# default to using dotenv files for all production environements
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
from .base import * # noqa
from .base import env # noqa
from .base import SILENCED_SYSTEM_CHECKS, env # noqa

# GENERAL
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -65,7 +65,7 @@
# Since we have disabled HSTS above we get a warning when running check --deploy
# we are manually silencing this as we have verified apache is enforcing
# https://docs.djangoproject.com/en/dev/ref/checks/#security
SILENCED_SYSTEM_CHECKS = ["security.W004"]
SILENCED_SYSTEM_CHECKS += ["security.W004"]
# STATIC
# ------------------------
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
Expand Down

0 comments on commit bebb991

Please sign in to comment.