Django 5.2 Upgrade
For upgrading an IDA from Django 4.2 to Django 5.2, the following milestones need to be completed. Each milestone includes the necessary guidelines and action plan to help teams identify the required steps.
Major Changes in django 5.*
Issues list
Issues can be found here
Discourse Announcement here
Upgrade Milestones
As part of the Django 5.2 upgrade effort, ensure the completion of all the following steps.
Phase 1 ( openedx-packages and 3rd party packages )
1. Fix Django 5.0, 5.1 and Django 5.2 Deprecation Warnings
When running tests against Django 4.2, you may see Django 5.x deprecation warnings in the test logs.
Use the third-party django-upgrade tool to fix most deprecation warnings and automatically refactor your code.
If any warnings persist, refer to the edx-platform deprecation issues to identify and resolve them.
2. Upgrade to Django 5.2 in tox & GitHub Actions Workflow
Add
django 5.2
intox
andgithub actions
with allow failure because tests might fail at this point.Fix tests failures or issues under 5.2 version.
Ensure that all tests pass 100% for both Django 4.2 and 5.2, and that there are no remaining deprecation warnings under Django 4.2.
Update the Trove classifiers in any
setup.py
,setup.cfg
, orpyproject.toml
files to reflect the Python and Django versions currently being testedRelease the version and use this in the required IDA.
Sample PR for
django5.2
support.
3. Update Requirements
The requirements upgrade process will run as usual, just like before, since we are only adding support for Django 5.2.
Note: For 3rd party packages try to create an issue in the repository, and in case of bandwidth try to fix that as well.
Phase 2. ( IDA upgrades)
1. Fix Django 5.0, 5.1 and Django 5.2 Deprecation Warnings
When running tests against Django 4.2, you may see Django 5.x deprecation warnings in the test logs.
Use the third-party django-upgrade tool to fix most deprecation warnings and automatically refactor your code. If any changes are unnecessary for Django 5.2, revert them as needed.
If any warnings persist, refer to the edx-platform deprecation issues to identify and resolve them and keep deploying small fixes on production.
2. Upgrade to Django 5.2 in tox & GitHub Actions Workflow
Add
django 5.2
intox
andgithub actions
Fix tests failures or issues under 5.2 version and keep deploying on production.
Ensure that all tests pass 100% for both Django 4.2 and 5.2, and that there are no remaining deprecation warnings under Django 4.2.
3. Update Requirements for deployment
Make one last final PR with django 5.2.
Update the pinned Django version in the requirements to Django==5.2
You’ll need to override the common constraints in the make upgrade compile target for upgrading the dependencies. For that the approach can be used to override the Django<5.0 common constraint.
Run make upgrade to update all dependencies for Django 5.2.
Upgrade your workflows to only use Django 5.2.
Generic testing guide lines for IDA.
Sandbox creation is working ( incase IDA has sandbox configuration )
If e-commerce is involved, try using checkout flow.
Run make migrations to ensure no new migrations are generated.
Run migrate to verify that no hidden migrations are executed.
Confirm that authentication processes work as expected and that upgrading to Django 5.2 does not log out previously signed-in users.
Try other critical test cases as per your IDA.
Phase 3. (After successful IDA upgrade to 5.2 )
Update packages and libraries.
1. Drop older Django versions in tox & GitHub Actions Workflow
Remove any versions other than django5.2 from tox and GA actions.
2. Update Requirements.
Update the pinned Django version in the requirements to Django==5.2
Run make upgrade.
Update the Trove classifiers in any setup.py, setup.cfg, or pyproject.toml files to reflect the Python and Django versions currently being tested and removed un-supported versions information.
Bump the version and also release.