Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support asyncio views #904

Merged
merged 2 commits into from
Feb 20, 2022
Merged

Support asyncio views #904

merged 2 commits into from
Feb 20, 2022

Conversation

bellini666
Copy link
Contributor

Use contextvars instead of threading.local to support async views.

I tried to do the smallest changes that I could, but using contextvars that code can be simplified a lot.

Use contextvars instead of threading.local to support async views.
@etianen
Copy link
Owner

etianen commented Feb 12, 2022

Hi,

Thanks for this! It's a good change. Unfortunately, it requires Python 3.7+, which is going to be supported by Django LTS until early 2024!

I'd like to keep this MR open until then, but I don't think I can drop support for Python 3.6 while Django LTS supports its.

Alternatively, I'd consider a compatibility shim that used contextvars and fell back to thread-local state. That seems like it would be a relatively unobtrusive change.

@bellini666
Copy link
Contributor Author

Hey @etianen ,

I would argue that, even though Django 3.2 (the current LTS) should be supported until early 2024, Python 3.6 already reached EOL (https://endoflife.date/python) and should not be used anymore by anyone. People using 3.2 can (and should) use at least Python 3.7 (the latest version supports even Python 3.10).

But if you really want to maintain compatibility, I can write a compatibility shim.

@etianen
Copy link
Owner

etianen commented Feb 12, 2022 via email

Python 3.6 has reached EOL on December 2021. It's time to upgrade!
@bellini666
Copy link
Contributor Author

@etianen nice :)
Just made the change, think it should be enough

@etianen etianen merged commit 6ff1dd5 into etianen:master Feb 20, 2022
@etianen
Copy link
Owner

etianen commented Feb 20, 2022

Thanks! I'll get this into a release ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants