Task #8488
closed[EPIC] Upgrade to django 3.2
100%
Description
See the subtasks for the identified work.
Related issues
Updated by dalley over 3 years ago
- Related to Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async) added
Updated by daviddavis over 3 years ago
Here's my branch: https://github.com/daviddavis/pulpcore/tree/django3
Most of everything is working aside from the task code (more on this below). The django-guid package has a 3.x version which they recommend using since it supports ASGI. However, it does not support Python 3.6. But it appears that django-guid 2.2 is working for now.
The biggest change will be handling django's ORM in our async code. Django's ORM is not async safe and therefore you have to use sync_to_async()
[0] when calling django's ORM (otherwise you get an error[1]).
Alternatively, there is a variable we can set DJANGO_ALLOW_ASYNC_UNSAFE
[2] but I don't think we should go this route. From the django docs, it says, "do not use this in production environments".
[0] https://docs.djangoproject.com/en/3.2/topics/async/#sync-to-async
[1] "SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async"
[2] https://docs.djangoproject.com/en/3.2/topics/async/#sync-to-async
Updated by dalley over 3 years ago
The compatibility status of django-guardian is a little unclear still. They have it in their test matrix but there is an unmerged PR addressing some compatibility issue.
Updated by daviddavis over 3 years ago
django-guardian 2.4.0 was released and it claims support for django 3.2.
Updated by bmbouter over 3 years ago
- Subject changed from Upgrade to django 3.2 to [Epic] Upgrade to django 3.2
- Description updated (diff)
Updated by bmbouter over 3 years ago
- Related to deleted (Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async))
Updated by daviddavis over 3 years ago
- Related to Task #8853: [EPIC] Drop support for Python 3.6 added
Updated by bmbouter over 3 years ago
- Related to deleted (Task #8853: [EPIC] Drop support for Python 3.6)
Updated by bmbouter over 3 years ago
- Blocked by Task #8853: [EPIC] Drop support for Python 3.6 added
Updated by daviddavis over 3 years ago
- Sprint/Milestone changed from 3.14.0 to 3.15.0
Updated by dalley over 3 years ago
- Sprint/Milestone deleted (
3.15.0)
We don't really need both the epic and the subtask, closing the subtask, making this one the "real" issue.
Updated by dalley over 3 years ago
- Subject changed from [Epic] Upgrade to django 3.2 to Upgrade to django 3.2
- Sprint/Milestone set to 3.15.0
Updated by bmbouter over 3 years ago
- Subject changed from Upgrade to django 3.2 to [EPIC] Upgrade to django 3.2
Updated by daviddavis about 3 years ago
- Sprint/Milestone deleted (
3.15.0)
Removing from 3.15 since the subtask that needs to block 3.15 is already assigned to 3.15.
Updated by dalley about 3 years ago
- Status changed from NEW to CLOSED - COMPLETE