Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is ASGI?

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what ASGI is." Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "what ASGI is"!

Before using ASGI features, let's understand what ASGI is.

ASGI and WSGI, both Web Services Gateway Interface Protocols, build on CGI standards.

CGI (Common Gateway Interface) is simply a common protocol that parses requests sent by clients such as browsers to servers and assembles HTTP requests that need to be returned. The program that handles this process can be called CGI script. The early dynamic web pages of the Internet were all CGI based.

WSGI is a Python-specific Web server gateway interface, which is divided into two parts: "server (or gateway)" and "application (or application framework)." A "server," generally independent of the application framework, provides environment information and a callback function for the application to run. When the application completes processing the request, it returns the result to the server via a callback function. Common WSGI servers include uwsgi and gunicon. "Application" is a variety of Python web frameworks that implement the WSGI standard, commonly used are Django, Flask, etc.

ASGI (Asynchronous Server Gateway Interface) is a Python web server gateway interface protocol with asynchronous functionality proposed by the Django team. It can handle a variety of common protocol types, including HTTP, HTTP2 and WebSocket. WSGI is based on HTTP protocol mode, does not support WebSocket, and ASGI was born to solve Python commonly used WSGI does not support some of the new protocol standards in the current Web development (WebSocket, Http2, etc.). Also, ASGI is backward compatible with WSGI standards and can run WSGI applications in a number of ways. Common "servers" include Daphne and Uvicorn.

At this point, I believe everyone has a deeper understanding of "what ASGI is". Let's do it in practice! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report