Skip to content

Commit

Permalink
Merge pull request #308 from torchbox/support/wagtail-6.2-upgrade
Browse files Browse the repository at this point in the history
Upgrade Wagtail to 6.2
  • Loading branch information
engineervix authored Nov 7, 2024
2 parents 2b508be + 74c173b commit 03bc0e5
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 221 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
language_version: python3.11
Expand All @@ -14,7 +14,7 @@ repos:
- id: isort
- repo: https://github.com/pycqa/flake8
# flake8 config is in setup.cfg
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8

Expand Down
427 changes: 227 additions & 200 deletions poetry.lock

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ authors = ["Torchbox Ltd"]
[tool.poetry.dependencies]
python = "^3.11"
Django = "~4.2"
wagtail = "~6.1"
wagtail = "~6.2"
psycopg2 = "^2.9.9"
gunicorn = {version = "^22.0.0", optional = true}
whitenoise = "^6.1.0"
phonenumbers = "^8.13.38"
gunicorn = {version = "^23.0.0", optional = true}
whitenoise = "^6.7.0"
phonenumbers = "^8.13.47"
Wand = "^0.6.10"

# Django packages
django-basic-auth-ip-whitelist = "^0.5"
django-basic-auth-ip-whitelist = "^0.6"
django-birdbath = "^2.0.0"
django-csp = "^3.7"
django-pattern-library = "^1.1.0"
django-permissions-policy = "^4.15.0"
django-phonenumber-field = "^7.0.2"
django-permissions-policy = "^4.22.0"
django-phonenumber-field = "^8.0.0"
django-redis = "^5.2.0"
django-referrer-policy = "~1.0"
django-storages = {version = "^1.14.3", extras = ["boto3"]}
django-storages = {version = "^1.14.4", extras = ["boto3"]}
dj-database-url = "^2.2.0"

# Wagtail packages
Expand All @@ -34,35 +34,36 @@ wagtailmedia = "^0.15.2"
wagtail-purge = "^0.4.0"

# Production
scout-apm = "^3.1.0"
sentry-sdk = "^2.5.1"
scout-apm = "^3.2.1"
sentry-sdk = "^2.16.0"
html5lib = "^1.1"
beautifulsoup4 = "^4.12.3"
django-xff = "^1.4.0"

[tool.poetry.extras]
gunicorn = ["gunicorn"]

[tool.poetry.group.dev.dependencies]
Werkzeug = "^3.0.3"
django-debug-toolbar = "^4.4.2"
Werkzeug = "^3.0.4"
django-debug-toolbar = "^4.4.6"
django-extensions = "^3.2.3"
fabric = "^3.2.2"
pudb = "^2024.1"
honcho = "^1.1.0"
honcho = "^2.0.0"

# Linters etc.
black = "^24.4.2"
black = "^24.10.0"
detect-secrets = "^1.5.0"
djhtml = "^3.0.6"
flake8 = "^7.0.0"
flake8 = "^7.1.1"
isort = "^5.13.2"
pre-commit = "^3.7.1"
pre-commit = "^4.0.1"
seed-isort-config = "^2.2.0"

# Documentation
mkdocs = "^1.6.0"
mkdocs-material = "^9.5.26"
pymdown-extensions = "^10.8.1"
mkdocs = "^1.6.1"
mkdocs-material = "^9.5.41"
pymdown-extensions = "^10.11.2"

# Testing
wagtail-factories = "^4.2.1"
Expand Down
3 changes: 3 additions & 0 deletions tbx/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"django.middleware.security.SecurityMiddleware",
"django_permissions_policy.PermissionsPolicyMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"xff.middleware.XForwardedForMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand Down Expand Up @@ -315,6 +316,7 @@
"level": "WARNING",
"propagate": False,
},
"xff": {"handlers": ["console"], "level": "WARNING", "propagate": False},
},
}

Expand Down Expand Up @@ -510,6 +512,7 @@
"BASIC_AUTH_WHITELISTED_HTTP_HOSTS"
].split(",")

XFF_TRUSTED_PROXY_DEPTH = int(env.get("XFF_TRUSTED_PROXY_DEPTH", 1))

AUTH_USER_MODEL = "users.User"

Expand Down
2 changes: 2 additions & 0 deletions tbx/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Disable debug mode
DEBUG = False

# Error if there aren't enough proxies in between
XFF_ALWAYS_PROXY = True

try:
from .local import * # noqa
Expand Down
3 changes: 3 additions & 0 deletions tbx/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]

WAGTAILADMIN_BASE_URL = "http://localhost:8000"

# Ignore proxy count in tests
XFF_ALWAYS_PROXY = False

0 comments on commit 03bc0e5

Please sign in to comment.