Skip to content

Conversation

@awdem
Copy link
Contributor

@awdem awdem commented Oct 16, 2025

Upgrade to django 5.2.7. Also bumps the following packages:

package bump changelog
django-extensions 3.2.3 > 4.1.0 Here
django-filter 25.1 > 25.2 Here
djangorestframework 3.15.2 > 3.16.1 Here
django-debug-toolbar 5.0.1 > 6.0.0 Here
pytest-django 4.10.0 > 4.11.1 Here
django-braces 1.16.0 > 1.17.0 Here
django-formtools 2.2 > 2.5.1 Here
django-storages 1.14.5 >1.14.6 Here
django-pipeline 4.0.0 > 4.1.0 Here
django-localflavor 4.0 > 5.0 Here

Notes:

  • django-braces latest release doesn't officially support django >4.2. It looks like there is a "spiritual successor" called django-brackets that is for django >4.2 and does the same things. However, for the stuff we're using from django-braces (LoginRequiredMixin, StaffuserRequiredMixin) doesn't seem broken , so not sure if it's worth switching from braces to brackets?
  • The django-formtools bump that caused issues outlined in upgrade django-formtools==2.5.1 (attempt 2) EveryElection#2537 doesn't seem to break anything on this repo. I'm not sure why and worried I'm missing something so it would be good to double check this assumption.
  • django-s3file has a 6.0.0 release on github that supports django 5.1, but its not on PyPi for some reason.
  • django-debug-toolbar wasn't actually set up properly so I did that.

Deprecations:

  • I've bumped dc-django-utils and replaced STATICFILES_STORAGE with the STORAGES dict. We weren't importing the default pipeline settings from dc_utils in this repo so I also implemented that.
  • I've bumped dc-design-system to the latest version but didn't need to update anything.
  • I've removed the USE_L10N setting which was deprecated in 4.0 and removed in 5.0. Its default behavior now.
  • I've remove django-querystring-tag because its part of core django now.

@awdem awdem marked this pull request as ready for review October 20, 2025 13:42
@awdem
Copy link
Contributor Author

awdem commented Oct 21, 2025

Per discussion on slack, I've removed django-braces and tested that the updated django-formtools doesn't increase the amount of database queries when using the form. It doesn't.

This PR has also been deployed to https://stage.electionleaflets.org/

@chris48s chris48s changed the title Django5 20251015 Django 5 upgrade Oct 21, 2025
from leaflets.models import Leaflet, LeafletImage
from leaflets.tests.conftest import TEST_IMAGE_LOCATION

TEST_STORAGES = settings.STORAGES.copy()
Copy link
Member

@chris48s chris48s Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Do we need to deepcopy() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we do. Done in bc08192

@chris48s
Copy link
Member

Its annoying that django-s3file isn't on PyPI but having looked over codingjoe/django-s3file@5.5.7...6.0.0 I don't think there is anything we need in it for django 5.2 compatibility so I reckon lets just stick on 5.5.7 rather than switch to a VCS dependency. I raised an issue upstream about it anyway.

@awdem awdem requested a review from chris48s October 22, 2025 08:13
@chris48s
Copy link
Member

will leave it with you to:

and merge

@awdem awdem merged commit ed4aba0 into master Oct 22, 2025
4 checks passed
@awdem awdem deleted the django5-20251015 branch October 22, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants