Skip to content

Commit

Permalink
Move a2wsgi to base dependencies and update docs accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
humrochagf committed Jan 6, 2023
1 parent 0e40358 commit c0b5bdd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<em>An ASGI web server, for Python.</em>
<em>An ASGI first web server, for Python.</em>
</p>

---
Expand All @@ -15,14 +15,16 @@

**Requirements**: Python 3.7+ (For Python 3.6 support, install version 0.16.0.)

Uvicorn is an ASGI web server implementation for Python.
Uvicorn is an ASGI first web server implementation for Python.

Until recently Python has lacked a minimal low-level server/application interface for
async frameworks. The [ASGI specification][asgi] fills this gap, and means we're now able to
start building a common set of tooling usable across all async frameworks.

Uvicorn supports HTTP/1.1 and WebSockets.

It also comes with support to WSGI applications out of the box.

## Quickstart

Install using `pip`:
Expand Down
25 changes: 23 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<em>An ASGI web server, for Python.</em>
<em>An ASGI first web server, for Python.</em>
</p>

<p align="center">
Expand All @@ -19,14 +19,16 @@

# Introduction

Uvicorn is an ASGI web server implementation for Python.
Uvicorn is an ASGI first web server implementation for Python.

Until recently Python has lacked a minimal low-level server/application interface for
async frameworks. The [ASGI specification][asgi] fills this gap, and means we're now able to
start building a common set of tooling usable across all async frameworks.

Uvicorn currently supports HTTP/1.1 and WebSockets.

It also comes with support to WSGI applications out of the box.

## Quickstart

Install using `pip`:
Expand Down Expand Up @@ -460,6 +462,25 @@ async def app(scope, receive, send):
})
```

## The WSGI Support

Uvicorn offer support to WSGI applications throught `WSGIMiddleware` from [a2wsgi](https://github.com/abersheeran/a2wsgi)
which converts your WSGI into ASGI application seamlessly by just running it with `--interface wsgi`

Create an application, in `example.py`:

```python
def app(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return [b'Hello World!']
```

Run the server:

```shell
$ uvicorn --interface wsgi example:app
```

---

## Why ASGI?
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
site_name: Uvicorn
site_description: The lightning-fast ASGI server.
site_description: The lightning-fast ASGI first server.

theme:
name: "material"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "uvicorn"
dynamic = ["version"]
description = "The lightning-fast ASGI server."
description = "The lightning-fast ASGI first server."
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.7"
Expand All @@ -29,14 +29,14 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"a2wsgi>=1.6.0,<2.0.0",
"click>=7.0",
"h11>=0.8",
"typing-extensions;python_version < '3.8'",
]

[project.optional-dependencies]
standard = [
"a2wsgi>=1.6.0,<2.0.0",
"colorama>=0.4;sys_platform == 'win32'",
"httptools>=0.5.0",
"python-dotenv>=0.13",
Expand Down

0 comments on commit c0b5bdd

Please sign in to comment.