Skip to content
Advertisement

Tag: asgi

Serving file asyncronously with Django and uvicorn

I have a Django view that serves the content of a file. The Django application was running with WSGI until recently. This worked fine. Then I adapted my application to use ASGI running uvicorn. The file serving is now broken as it seems to loose the connection. How can I serve the file asynchronously with Django and uvicorn? Current view:

Advertisement