Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesroberts/fastwsgi
An ultra fast WSGI server for Python 3
https://github.com/jamesroberts/fastwsgi
c django flask python server web-server werkzeug wsgi wsgi-server
Last synced: 6 days ago
JSON representation
An ultra fast WSGI server for Python 3
- Host: GitHub
- URL: https://github.com/jamesroberts/fastwsgi
- Owner: jamesroberts
- License: other
- Created: 2021-08-02T20:00:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T08:21:32.000Z (over 1 year ago)
- Last Synced: 2025-01-08T09:04:56.509Z (13 days ago)
- Topics: c, django, flask, python, server, web-server, werkzeug, wsgi, wsgi-server
- Language: C
- Homepage:
- Size: 8.39 MB
- Stars: 442
- Watchers: 18
- Forks: 13
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
--------------------------------------------------------------------
[![Tests](https://github.com/jamesroberts/fastwsgi/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jamesroberts/fastwsgi/actions/workflows/tests.yml)
[![Pypi](https://img.shields.io/pypi/v/fastwsgi.svg?style=flat)](https://pypi.python.org/pypi/fastwsgi)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/jamesroberts/fast-wsgi.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jamesroberts/fastwsgi/context:cpp)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/jamesroberts/fast-wsgi.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jamesroberts/fastwsgi/context:python)# FastWSGI
:construction: FastWSGI is still under development.
FastWSGI is an ultra fast WSGI server for Python 3.
Its written in C and uses [libuv](https://github.com/libuv/libuv) and [llhttp](https://github.com/nodejs/llhttp) under the hood for blazing fast performance.
## Supported Platforms
| Platform | Linux | MacOs | Windows |
| :------: | :---: | :---: | :-----: |
| Support | :white_check_mark: | :white_check_mark: | :white_check_mark: |## Performance
FastWSGI is one of the fastest general use WSGI servers out there!
For a comparison against other popular WSGI servers, see [PERFORMANCE.md](./performance_benchmarks/PERFORMANCE.md)
## Installation
Install using the [pip](https://pip.pypa.io/en/stable/) package manager.
```bash
pip install fastwsgi
```## Quick start
Create a new file `example.py` with the following:
```python
import fastwsgidef app(environ, start_response):
headers = [('Content-Type', 'text/plain')]
start_response('200 OK', headers)
return [b'Hello, World!']if __name__ == '__main__':
fastwsgi.run(wsgi_app=app, host='0.0.0.0', port=5000)
```Run the server using:
```bash
python3 example.py
```Or, by using the `fastwsgi` command:
```bash
fastwsgi example:app
```## Example usage with Flask
See [example.py](https://github.com/jamesroberts/fast-wsgi/blob/main/example.py) for more details.
```python
import fastwsgi
from flask import Flaskapp = Flask(__name__)
@app.get('/')
def hello_world():
return 'Hello, World!', 200if __name__ == '__main__':
fastwsgi.run(wsgi_app=app, host='127.0.0.1', port=5000)
```## Testing
To run the test suite using [pytest](https://docs.pytest.org/en/latest/getting-started.html), run the following command:
```bash
python3 -m pytest
```## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests where appropriate.
## Significant Contributions
Special thank you to the following individuals who have made significant contributions to FastWSGI:
- Oleg S. ([@remittor](https://github.com/remittor))
## TODO
- Comprehensive error handling
- Complete HTTP/1.1 compliance
- Unit tests running in CI workflow