mirror of
https://github.com/jamesroberts/fastwsgi.git
synced 2025-12-19 21:29:36 -06:00
3bec40d635d673cfd076c9f4a625e823f80a861c
FastWSGI
Note: FastWSGI is still under development...
FastWSGI is an ultra fast WSGI server for Python 3.
It is mostly written in C. It makes use of libuv and llhttp under the hood for blazing fast performance.
Installation
Install using the pip package manager.
pip install fastwsgi
Example usage with Flask
See example.py for more details.
import fastwsgi
from flask import Flask
app = Flask(__name__)
@app.get("/")
def hello_world():
return "Hello, World!", 200
if __name__ == "__main__":
fastwsgi.run(wsgi_app=app, host="127.0.0.1", port=5000)
Example usage with uWSGI
def application(environ, start_response):
start_response("200 OK", [("Content-Type", "text/plain")])
return [b"Hello, World!"]
if __name__ == "__main__":
fastwsgi.run(wsgi_app=application, host="127.0.0.1", port=5000)
Testing
To run the test suite using pytest, run the following command:
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 as appropriate.
TODO
- Comprehensive error handling
- Complete HTTP/1.1 compliance
- Test on multiple platforms (Windows/MacOS)
- Unit tests running in CI workflow
- Invoke WSGI app from server.c (from within libuv loop) instead of in request.c (in llhttp parsing callbacks)
Description
Languages
C
78.5%
Python
18.7%
Shell
2.4%
Makefile
0.3%
Batchfile
0.1%