Uvicorn: the ASGI server
First, let’s see where we came from, namely, WSGI. WSGI stands for Web Server Gateway Interface, a standard interface between web servers and Python web applications. It has been the de facto standard for Python web applications for many years. However, the Asynchronous Server Gateway Interface (ASGI) was introduced to address the needs of modern web applications, particularly those requiring asynchronous capabilities. So, with ASGI, we can handle asynchronous requests more efficiently in a way we couldn’t with WSGI.
Uvicorn is a lightning-fast ASGI server implementation, using uvloop and httptools. It’s perfect for serving your FastAPI applications and can handle both HTTP and WebSocket protocols. uvloop is a fast implementation of the event loop, which is the core of asynchronous programming in Python. httptools is a library for parsing HTTP requests and responses. Uvicorn works seamlessly with FastAPI and can, for example, start...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                