Django สมัยใหม่ (3.1+) รองรับ async view โดยใช้ async/await ของ Python ซึ่งช่วยให้จัดการการทำงานพร้อมกันที่ I/O-bound ได้อย่างมีประสิทธิภาพ (การเรียก external API, การเข้าถึงฐานข้อมูลแบบ async) โดยไม่บล็อก สิ่งนี้เสริมโมเดล synchronous แบบดั้งเดิมของ Django สำหรับกรณีการใช้งานเฉพาะ
Async view
():
data = requests.get().json()
JsonResponse(data)
httpx
():
httpx.AsyncClient() client:
response = client.get()
JsonResponse(response.json())
