Project

Profile

Help

Task #8488

Upgrade to django 3.2

Added by daviddavis 15 days ago. Updated 8 days ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

As a first step, we need to determine how much work will be involved with this change and what impact it will have on pulpcore and plugins.


Related issues

Related to Pulp - Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async)NEW

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by dalley 15 days ago

  • Related to Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async) added

#2 Updated by daviddavis 8 days 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

Please register to edit this issue

Also available in: Atom PDF