Un framework web minimaliste et indépendant
Project description
WebForge Version 3.0.0 first final release
WebForge is a lightweight, dependency-free Python mini-framework for building small websites and simple web apps with a very small API.
It lets you:
- register routes for HTML pages
- serve static assets such as CSS and JavaScript
- protect routes with a simple password gate
- run a small local HTTP server with the Python standard library
Features
- Simple route registration with
WebForge.route()orWebForge.new_route() - Easy security setup with
WebForge.set_password() - Minimal built-in server via
WebForge.run() - No external web framework dependency required
Installation
pip install webforge
Quick Start
from webforge import WebForge
app = WebForge(__name__)
@WebForge.apps
def apps():
WebForge.new_route("/", "index.html")
WebForge.route("/login", "login.html")
@WebForge.security
def secs():
WebForge.set_password("/", "password", "/login")
if __name__ == "__main__":
WebForge.run(port=5000, host="0.0.0.0")
Project Layout
Create a Public folder in your project and organize your files like this:
Public/
├── Render/
│ ├── index.html
│ └── login.html
└── Style/
└── main.css
- HTML pages should be placed in
Public/Render/ - CSS and JavaScript files can be served from
Public/Style/orPublic/src/
Route Example
WebForge.new_route("/", "index.html")
WebForge.route("/about", "about.html")
The route() method is simply an alias of new_route().
Security Example
WebForge.set_password("/admin", "secret123", "/login")
This lets you protect a route by requiring the password=... cookie to be present.
Run the App
python your_app.py
Then open your browser at:
http://localhost:5000/
License
This project is distributed under the MIT License.
Status
WebForge is a small experimental framework intended for learning, lightweight internets, and simple personal site projects.
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 webforge-3.0.0.tar.gz.
File metadata
- Download URL: webforge-3.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75de507d833d9ccbaf76c98340f1a8f06fe6e74ac1a819f0a024f97f05839438
|
|
| MD5 |
c78314757cc3829e2dd37c51a6845f87
|
|
| BLAKE2b-256 |
d93055ecfa0626e44e00b72e629f1d8fc01702713a06b33fd88046ef6f9c7f84
|
File details
Details for the file webforge-3.0.0-py3-none-any.whl.
File metadata
- Download URL: webforge-3.0.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1be20b907c802bfb14fc53229d4dcdf8316a74b83be4dcf82c3b0eb33b8a910
|
|
| MD5 |
461fbf9fb227e507caaa4ab18490f41c
|
|
| BLAKE2b-256 |
3c1877ba396d55dfd0b16865747cd37cef2726240ef813c6efcad9a1256e8529
|