Skip to main content
Django supports async views even when running under WSGI servers like Gunicorn, but this setup doesn’t deliver the full performance benefits of asynchronous execution. To take full advantage of async views in Django, your application must be run with an ASGI server. Instead of Gunicorn, install an ASGI server like Granian and add it to your requirements.txt file.
pip install granian
pip freeze > requirements.txt
Within Sevalla, update your start command to a custom one that uses Granian in Processes > Web process > Update process.
granian --interface asginl example.asgi:application --host 0.0.0.0 --port 8080
The name of your project and the port can be changed to match your app.