Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configured Github workflows to use CI settings and requirements #403

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
python src/manage.py collectstatic --noinput --link
coverage run src/manage.py test src
env:
DJANGO_SETTINGS_MODULE: open_inwoner.conf.dev
DJANGO_SETTINGS_MODULE: open_inwoner.conf.ci
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
Expand Down
51 changes: 44 additions & 7 deletions src/open_inwoner/conf/ci.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import warnings

os.environ.setdefault("DEBUG", "no")
os.environ.setdefault("ENVIRONMENT", "ci")
Expand All @@ -8,7 +9,6 @@

from .base import * # noqa isort:skip


LOGGING["loggers"].update(
{
"django": {
Expand All @@ -19,12 +19,49 @@
}
)

CACHES.update(
{
"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
# See: https://github.com/jazzband/django-axes/blob/master/docs/configuration.rst#cache-problems
"axes": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"},
"oidc": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
}
)

# in memory cache and django-axes don't get along.
# https://django-axes.readthedocs.io/en/latest/configuration.html#known-configuration-problems
CACHES = {
"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"},
"axes": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"},
}
# Allow logging in with both username+password and email+password
AUTHENTICATION_BACKENDS = [
"open_inwoner.accounts.backends.CustomAxesBackend",
"open_inwoner.accounts.backends.UserModelEmailBackend",
"django.contrib.auth.backends.ModelBackend",
# mock login like dev.py
"digid_eherkenning.mock.backends.DigiDBackend",
"open_inwoner.accounts.backends.CustomOIDCBackend",
]

ELASTIC_APM["DEBUG"] = True

ELASTICSEARCH_DSL_AUTO_REFRESH = False
ELASTICSEARCH_DSL_AUTOSYNC = False
ES_INDEX_PRODUCTS = "products_test"

ENVIRONMENT = "CI"

#
# Django-axes
#
AXES_BEHIND_REVERSE_PROXY = False

# Django privates
SENDFILE_BACKEND = "django_sendfile.backends.development"

# Two factor auth
TWO_FACTOR_FORCE_OTP_ADMIN = False
TWO_FACTOR_PATCH_ADMIN = False

# THOU SHALT NOT USE NAIVE DATETIMES
warnings.filterwarnings(
"error",
r"DateTimeField .* received a naive datetime",
RuntimeWarning,
r"django\.db\.models\.fields",
)