Skip to content

leafcoder/litefs

Repository files navigation

Litefs

GitHub forks GitHub forks GitHub forks

GitHub release (latest by date) GitHub top language GitHub code size in bytes GitHub commit activity PyPI - Downloads

Litefs is a lite python web framework.

Build a web server framework using Python. Litefs was developed to implement a server framework that can quickly, securely, and flexibly build Web projects. Litefs is a high-performance HTTP server. Litefs has the characteristics of high stability, rich functions, and low system consumption.

Features

  • High-performance HTTP server with epoll and greenlet
  • WSGI 1.0 compliant (PEP 3333)
  • Support for Gunicorn, uWSGI, Waitress, and other WSGI servers
  • Static file serving with gzip/deflate compression
  • Mako template engine support
  • CGI script execution (.pl, .py, .php)
  • Session management
  • Multi-level caching system (Memory + Tree cache)
  • File monitoring and hot reload
  • Python 2.6-3.14 support

Quick Start

Installation

pip install litefs

Or install from source:

git clone https://github.com/leafcoder/litefs.git
cd litefs
pip install -r requirements.txt
python setup.py install

Basic Usage

Standalone Server

import litefs
litefs.test_server()

Or from command line:

litefs --host localhost --port 9090 --webroot ./site

WSGI Deployment

Litefs now supports WSGI deployment with Gunicorn, uWSGI, and other WSGI servers.

Create wsgi_example.py:

import litefs
app = litefs.Litefs(webroot='./site')
application = app.wsgi()

Deploy with Gunicorn:

gunicorn -w 4 -b :8000 wsgi_example:application

Deploy with uWSGI:

uwsgi --http :8000 --wsgi-file wsgi_example.py

Deploy with Waitress (Windows):

waitress-serve --port=8000 wsgi_example:application

For detailed deployment instructions, see WSGI_DEPLOYMENT.md.

Project Structure

litefs/
├── litefs.py              # Core module
├── setup.py              # Installation configuration
├── requirements.txt       # Dependencies
├── wsgi_example.py       # WSGI example
├── demo/                 # Example code
│   ├── site/            # Example website
│   └── example.py       # Example startup script
├── test/                # Test code
└── docs/                # Documentation

Documentation

Complete documentation is available at docs/:

构建文档

使用 Sphinx 构建文档:

make docs-build

查看文档:

make docs-serve

访问 http://localhost:8000 查看文档。

License

MIT License - see LICENSE for details.

About

Build a web server framework using Python. Litefs was developed to implement a server framework that can quickly, securely, and flexibly build Web projects. Litefs is a high-performance HTTP server. Litefs has the characteristics of high stability, rich functions, and low system consumption.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors