How can I convert the handler404 & handler500 to async views?
I currently have this in urls.py:
handler404 = 'hfapps.content.views.handler404' handler500 = 'hfapps.content.views.handler500'
And in views.py I tried to use async views:
async def handler404(request, *args, **kwargs): ...
but I got this error:
/usr/local/lib/python3.8/site-packages/django/views/debug.py:103: RuntimeWarning: coroutine 'handler404' was never awaited cleansed = [self.cleanse_setting('', v) for v in value] RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Can you please advice what is the correct way to use async 404/500 custom handlers?
NOTE: I’m already using async for my rest views, and they are working as expected.