A simple fast web framework
Project description
dustapi - A Simple Python Web Framework
dustapi is a lightweight web framework written in Python, designed to be simple and easy to use. It provides basic routing and response handling, making it a great starting point for learning about web frameworks or building small web applications.
Features
- Simple and intuitive routing
- Support for all HTTP methods (GET, POST, PUT, DELETE, etc.)
- WebSocket support
- Custom response types (JSON, HTML, etc.)
- Middleware support (planned)
- Extensible and lightweight
- Auto generate docs with swagger
- Support for jwt and session manager
Installation
To install dustapi, you can simply clone the repository and install the necessary dependencies:
git clone https://github.com/godwins3/dustapi.git
cd dustapi
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Usage
Here is a simple example of how to create a web application using dustapi:
Create a dustapi project
dustapi createproject
Run dustapi server
dustapi runserver --host 0.0.0.0 --port 8000 --template-folder mytemplates --static-folder mystatic --log-file myapp.log
Example
# examples/app.py
from dustapi.application import Application
from dustapi.responses import JsonResponse, HtmlResponse
app = Application()
@app.route('/')
def home():
return HtmlResponse("<h1>Welcome to dustapi Framework!</h1>")
@app.route('/hello')
def hello():
return "Hello, World!"
@app.route('/json')
def json_example():
data = {"message": "This is a JSON response"}
return JsonResponse(data)
if __name__ == '__main__':
from werkzeug.serving import run_simple
run_simple('localhost', 5000, app)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dustapi-0.0.1.tar.gz.
File metadata
- Download URL: dustapi-0.0.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c247ea40ed9dc0f37ab6e3dd05f861607d5ab45f0d0746c598a8b583ec2bdf42
|
|
| MD5 |
32635eda2db66c4a06e971fe15300e76
|
|
| BLAKE2b-256 |
ec5ce6b9d0e7c584d0958cfdcdc83ac900cd53f027292ef05cc510f24ffa8ca1
|
File details
Details for the file dustapi-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dustapi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f142fcc04409e27fb92ba248879c2cba4d9dc513f02d39002ec533889039cf3
|
|
| MD5 |
ad597e0bc06ceb9c1255da22331bff88
|
|
| BLAKE2b-256 |
c8922094ced4f1fbf1e8ec6695d4872774c15e9f4065774be287bd86dce57f09
|