Closed Bug 1607696 Opened 5 years ago Closed 5 years ago

Update to Django 2

Categories

(Webtools Graveyard :: Pontoon, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mathjazz, Assigned: jotes)

References

Details

(Whiteboard: pontoon-django-2)

Attachments

(4 files)

Django 1.11 LTS reaches end of extended support in April 2020:
https://www.djangoproject.com/download/

We should upgrade to Django 2.2 LTS, and afterwards possibly to 3.0.

Note that the on_delete argument for ForeignKey and OneToOneField is now required in models and migrations. We could use the Django update as an opportunity to make deleting user accounts easier by setting on_delete=models.SET_NULL on the User ForeignKeys. See bug 1561663 for more details.

No longer blocks: 1561663
See Also: → 1561663
Assignee: nobody → poke

As We discussed at All Hands Brrlin, I'll write a small spec to make this migration smooth.

Whiteboard: pontoon-django-3
See Also: → 1597053

Hey everyone,

Here's a very short-term plan about the migration to Django 2.2.
I don't know if all of these points can be mapped into separate bugs (?) and how many pull requests this will take.

I'll start with things that shouldn't break the existing code:

After that, We can prepare a PR which will finish the migration:

  • Update Pontoon to use Django 2.2
  • Set (SESSION|CSRF)_COOKIE_SAMESITE and remove the django-cookies-samesite from the list of the dependencies
  • Fix unittests if they fail on Django 2.2
  • Check the sync (:mathjazz / :adrian, I'll need help with that)

Additional questions:

  • :adrian, :mathjazz: Do we want to squash existing migrations?
Flags: needinfo?(m)
Flags: needinfo?(adrian)

Thanks for the update, jotes!

I don't have strong opinions here, so I'll leave the decision about squashing migrations to Adrian.

Flags: needinfo?(m)

You'll need to squash migrations, as Django 2.x will refuse to start if you have old migrations w/out on_delete. So that needs to happen after the change to the models, but before you get off of 1.11.

Clearing NI on Adrian, as there's no choice.

Flags: needinfo?(adrian)

Once on Django 2/3, we should update django-allauth to the latest version:
https://github.com/mozilla/pontoon/pull/1588#issuecomment-599763118

See Also: → 1627655

Let's continue the upgrade process under bug 1627655.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Summary: Update to Django 2/3 → Update to Django 2
Whiteboard: pontoon-django-3 → pontoon-django-2
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: