Skip to content

Commit

Permalink
Mise à jour de Wagtail en version 6.4 (#270)
Browse files Browse the repository at this point in the history
* Update Wagtail to version 6.4, start moving to just

* Update CI to manage multiple versions of PostgreSQL
  • Loading branch information
Ash-Crow authored Feb 18, 2025
1 parent 520d9b2 commit 1fc7df4
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 105 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ jobs:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: config.settings_test
PYTHONPATH: .
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
# Only include the first and last supported pgsql versions to limit
# the number of jobs
postgresql-version: [13, 17]
services:
postgres:
image: postgres:14-alpine
image: postgres:${{ matrix.postgresql-version }}-alpine
env:
POSTGRES_USER: dju
POSTGRES_PASSWORD: djpwd
POSTGRES_DB: djdb
POSTGRESQL_VERSION: ${{ matrix.postgresql-version }}
ports:
- 5432:5432
steps:
Expand Down
2 changes: 1 addition & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True if os.getenv("DEBUG") == "True" else False

ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "127.0.0.1, localhost").replace(" ", "").split(",")
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "127.0.0.1,.localhost").replace(" ", "").split(",")

HOST_URL = os.getenv("HOST_URL", "localhost")

Expand Down
2 changes: 2 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.urls import include, path
from django.views.generic.base import RedirectView
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls

Expand All @@ -11,6 +12,7 @@
path(settings.WAGTAILADMIN_PATH, include(wagtailadmin_urls)),
path("documents/", include(wagtaildocs_urls)),
path("api/v2/", api_router.urls),
path("favicon.ico", RedirectView.as_view(url="/static/dsfr/dist/favicon/favicon.ico", permanent=True)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += i18n_patterns(
Expand Down
2 changes: 1 addition & 1 deletion dashboard/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def render(self, request) -> str:


@hooks.register("construct_wagtail_userbar")
def add_page_api_link_item(request, items):
def add_page_api_link_item(request, items, page):
return items.append(UserbarPageAPILinkItem())
25 changes: 25 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set dotenv-load
set shell := ["bash", "-uc"]

poetry_run := if env("USE_POETRY", "0") == "1" { "poetry run" } else { "" }

default:
just -l

alias mm:= makemigrations
makemigrations app="":
{{poetry_run}} python manage.py makemigrations {{app}}

alias mi := migrate
migrate app="" version="":
{{poetry_run}} python manage.py migrate {{app}} {{version}}

mmi:
just makemigrations
just migrate

test app="":
{{poetry_run}} python manage.py test {{app}} --buffer --parallel

unittest app="":
{{poetry_run}} python manage.py test {{app}} --settings config.settings_test
Loading

0 comments on commit 1fc7df4

Please sign in to comment.