2018-11-15 02:47:40 +01:00
|
|
|
# Upgrading Django
|
|
|
|
|
|
|
|
This article documents notes on the process for upgrading Zulip to
|
2021-08-20 21:53:28 +02:00
|
|
|
new major versions of Django. Here are the steps:
|
2018-11-15 02:47:40 +01:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- Carefully read the Django upstream changelog, and `git grep` to
|
2018-11-15 02:47:40 +01:00
|
|
|
check if we're using anything deprecated or significantly modified
|
|
|
|
and put them in an issue (and then starting working through them).
|
|
|
|
Also, note any new features we might want to use after the upgrade,
|
|
|
|
and open an issue listing them;
|
|
|
|
[example](https://github.com/zulip/zulip/issues/2564).
|
2021-08-20 21:45:39 +02:00
|
|
|
- Start submitting PRs to do any deprecation-type migrations that work
|
2021-08-20 21:53:28 +02:00
|
|
|
on both the old and new version of Django. The goal here is to have
|
2018-11-15 02:47:40 +01:00
|
|
|
the actual cutover commit be as small as possible, and to test as
|
|
|
|
much of the changes for the migration as we can independently from
|
|
|
|
the big cutover.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Check the version support of the third-party Django packages we use
|
2018-11-15 02:47:40 +01:00
|
|
|
(`git grep django requirements/` to see a list), upgrade any as
|
2021-08-20 21:53:28 +02:00
|
|
|
needed and file bugs upstream for any that lack support. Look into
|
2018-11-15 02:47:40 +01:00
|
|
|
fixing said bugs.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Look at the pieces of Django code that we've copied and then
|
2018-11-15 02:47:40 +01:00
|
|
|
adapted, and confirm whether Django has any updates to the modified
|
2021-08-20 21:53:28 +02:00
|
|
|
code we should apply. Partial list:
|
2021-08-20 21:45:39 +02:00
|
|
|
- `CursorDebugWrapper`, which we have a modified version of in
|
2021-08-20 21:53:28 +02:00
|
|
|
`zerver/lib/db.py`. See
|
2018-11-15 02:47:40 +01:00
|
|
|
[the issue for contributing this upstream](https://github.com/zulip/zulip/issues/974)
|
2021-08-20 21:45:39 +02:00
|
|
|
- `PasswordResetForm` and any other forms we import from
|
2018-11-15 02:47:40 +01:00
|
|
|
`django.contrib.auth.forms` in `zerver/forms.py` (which has all of
|
|
|
|
our Django forms).
|
2021-08-20 21:45:39 +02:00
|
|
|
- Our AsyncDjangoHandler class has some code copied from the core
|
2018-02-02 05:43:18 +01:00
|
|
|
Django handlers code; look at whether that code was changed in
|
|
|
|
Django upstream.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Our `FilteredManagementUtility` in `manage.py`, which forks the
|
2021-06-17 20:32:43 +02:00
|
|
|
management command discovery code.
|
2021-08-20 21:45:39 +02:00
|
|
|
- `zerver/management/commands/change_password.py` is forked from the
|
2021-07-09 21:36:07 +02:00
|
|
|
upstream `changepassword.py`.
|