Skip to content

Calling tasks from a synchronous context #111

Answered by tyleralbee
tyleralbee asked this question in Q&A
Discussion options

You must be logged in to vote

@s3rius No worries, I understand you're busy. Your answer sounds logical - that said, it seemed more reasonable in my case to just make my views asynchronous, too. That's how adrf solved my issue; adrf is just a library for adding async support to Django REST framework.

It's probably important to note: I realize I never mentioned in the original post that the view in my example inherited from generics.CreateAPIView, which is provided by rest_framework (Django REST framework). DRF doesn't support async views out of the box, but has recently suggested that people use adrf as an add-on to add support for async views.

The view can be made async instead by first installing adrf:

pip install adrf

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@s3rius
Comment options

@tyleralbee
Comment options

Answer selected by s3rius
@s3rius
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants