Hi,
The docs say the following about using async with CBVs:
Any view can be declared async by making the callable part of it return a coroutine - commonly, this is done using async def. For a function-based view, this means declaring the whole view using async def. For a class-based view, this means declaring the HTTP method handlers, such as get() and post() as async def (not its init(), or as_view()).
But what does that mean in relation to urls.py where I’d normally call e.g.:
path("jobs/<int:pk>", JobView.as_view(), name="jobgroup_detail"),
This doesn’t work with uvicorn:
class JobView(
LoginRequiredMixin,
View,
):
async def get(self, request, *args, **kwargs):
action = request.GET.get("action", "")
....
It previously worked before I changed to CBV, so the async stuff is all set up properly.