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

Consider using Django 4.1+ Async ORM #1

Open
johnthagen opened this issue Apr 13, 2023 · 4 comments
Open

Consider using Django 4.1+ Async ORM #1

johnthagen opened this issue Apr 13, 2023 · 4 comments

Comments

@johnthagen
Copy link
Collaborator

I believe that the @database_sync_to_async used within this project could be removed by using the Async ORM Interface introduced in Django 4.1.

@YegorDB
Copy link
Owner

YegorDB commented Apr 13, 2023

This will be great improvement. Thanks for this idea.

@johnthagen
Copy link
Collaborator Author

You'll want to update the minimum supported Django version, but I suspect most users using this project will want to use as much async as possible.

@johnthagen
Copy link
Collaborator Author

Since this project uses Django directly, I would recommend adding Django to the install_requires explicitly:

install_requires=["channels>=3"],

You probably want to add "django>=3.2" to target the oldest supported Django release, but if you were to rely on the Async ORM interface, then you'd want to bump this to "django>=4.1".

By explicitly listing the dependencies you interact directly, this allows you to control minimum versions you support so you can rely on features like this.

@johnthagen
Copy link
Collaborator Author

Note that I have run into a couple issues related to Channels and the Async ORM:

So this may be something that is best deferred until the Async ORM matures and is more widely used.

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

No branches or pull requests

2 participants