asgi-debug-0.1
توضیحات
ASGI middleware for debugging ASGI applications
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | asgi-debug-0.1 |
| نام | asgi-debug |
| نسخه کتابخانه | 0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Simon Willison |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/simonw/asgi-debug |
| آدرس اینترنتی | https://pypi.org/project/asgi-debug/ |
| مجوز | Apache License, Version 2.0 |
# asgi-debug
[](https://pypi.org/project/asgi-debug/)
[](https://circleci.com/gh/simonw/asgi-debug)
[](https://github.com/simonw/asgi-debug/blob/master/LICENSE)
ASGI middleware for debugging ASGI applications
## Installation
pip install asgi-debug
## Usage
Wrap your application in the middleware like this:
```python
from asgi_debug import asgi_debug_decorator
@asgi_debug_decorator()
async def hello_world_app(scope, receive, send):
assert scope["type"] == "http"
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [[b"content-type", b"application/json"]],
}
)
await send({"type": "http.response.body", "body": b'{"hello": "world"}'})
```
When you run the app, debugging information will print to your terminal.
If you save the above in `demo.py` you can `pip install uvicorn` and run it like this:
```
uvicorn demo:hello_world_app
```
نیازمندی
| مقدار | نام |
|---|---|
| - | pytest |
| - | pytest-asyncio |
| ==3.1.2 | asgiref |
نحوه نصب
نصب پکیج whl asgi-debug-0.1:
pip install asgi-debug-0.1.whl
نصب پکیج tar.gz asgi-debug-0.1:
pip install asgi-debug-0.1.tar.gz