We're working around it with some funky decorator usage:
{{{
@sync_to_async
@login_required
@async_to_sync
async def our_view(request):
}}}
Buuuut, it'd be great not to need to do all this and to either have an
async version of login_required (@alogin_required, perhaps?) or for it to
just work with async views.
I don't think there's an open issue for this, but amusingly, in
[https://code.djangoproject.com/ticket/31949#comment:27 a comment 11
months ago], Carlton Gibson touched on making login_required work with
async, but he thought it'd take another five years. Perhaps we can do
better. :)
--
Ticket URL: <https://code.djangoproject.com/ticket/35030>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.