The Blazing-Fast ASGI Lightweight Python Web Framework
Build full-stack web apps and APIs with JsWeb. Pure Python, pure speed.
PyPI version License Downloads
Discord Documentation Sponsor GitHub PayPal Sponsor
Contributors
JsWeb is a modern, high-performance Python web framework built from the ground up on the ASGI standard. It's designed for developers who want the speed of asynchronous programming with the simplicity of a classic framework. With built-in, zero-configuration AJAX and a focus on developer experience, JsWeb makes it easy to build fast, dynamic web applications without writing a single line of JavaScript.
- β‘ Lightning Fast - ASGI-based async framework handles thousands of concurrent connections
- π― Developer Experience - Simple, intuitive API inspired by Flask with modern features
- π Full-Stack Ready - Everything you need: routing, forms, templates, database, admin panel
- π Zero-Config AJAX - Automatic SPA-like experience without JavaScript
- π‘οΈ Security First - CSRF protection, secure sessions, password hashing built-in
- π¦ Production Ready - Auto-generated admin panel, API docs, and more
- π Blazing-Fast ASGI Core - Built for speed and concurrency, compatible with servers like Uvicorn
- π Zero-Config AJAX - Forms and navigation automatically handled for a smooth SPA feel
- π£οΈ Elegant Routing - Simple decorator-based route definition
- π¨ Jinja2 Templating - Powerful templating engine with inheritance and macros
- π‘οΈ Built-in Security - CSRF protection, password hashing, and secure session management
- π Full-Featured Forms - Form validation, file uploads, and field types
- ποΈ SQLAlchemy Integration - ORM with Alembic migrations included
- βοΈ Automatic Admin Panel - Production-ready data management interface generated automatically
- π§© Modular Blueprints - Organize code into clean, reusable components
- π οΈ Powerful CLI - Create projects, run server, and manage database from command line
- π Auto API Documentation - OpenAPI 3.0.3 docs at
/docs,/redoc, and/openapi.json - π Hybrid DTO System - Uses Pydantic v2 internally with clean JsWeb API
pip install jsweb
jsweb new my_project
cd my_projectjsweb run --reload
Visit http://127.0.0.1:8000 and your app is live! π
Here's a simple but complete JsWeb application:
views.py - Define your routes
from jsweb import Blueprint, render views_bp = Blueprint('views') @views_bp.route("/") async def home(req): return render(req, "welcome.html", {"name": "World"}) @views_bp.route("/api/status") async def status(req): return {"status": "online", "message": "Hello from JsWeb!"}
app.py - Wire it all together
from jsweb import JsWebApp from views import views_bp import config app = JsWebApp(config=config) app.register_blueprint(views_bp) # Run with: jsweb run --reload
That's all you need for a working application!
Get up and running in under a minute.
- Python 3.8+ (Python 3.10+ recommended)
- pip (Python package manager)
- A text editor or IDE
# Create and activate virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
pip install jsweb
jsweb new my_awesome_app
cd my_awesome_appjsweb db prepare -m "Initial migration"
jsweb db upgradejsweb run --reload
Visit http://127.0.0.1:8000 - your app is running! π
JsWeb includes powerful CLI tools to streamline development:
jsweb run --reload # Auto-reload on changes jsweb run --host 0.0.0.0 # Accessible from network jsweb run --port 5000 # Custom port jsweb run --reload --qr # QR code for mobile access
jsweb new my_project # Create new project with boilerplate cd my_project
jsweb db prepare -m "Message" # Generate migration jsweb db upgrade # Apply migrations jsweb db downgrade # Revert last migration
jsweb create-admin # Interactive admin user creationComplete documentation available at https://jsweb-framework.site
- Getting Started - Installation and setup
- Routing - URL mapping and HTTP methods
- Templating - Jinja2 templates and filters
- Database - Models, queries, and migrations
- Forms - Form handling and validation
- Blueprints - Modular application structure
- Admin Panel - Data management interface
- Configuration - App settings
- CLI Reference - Command-line tools
- OpenAPI Guide - API documentation
Organize your application into logical modules:
from jsweb import Blueprint # Create a blueprint auth_bp = Blueprint('auth', url_prefix='/auth') @auth_bp.route('/login', methods=['GET', 'POST']) async def login(req): return render(req, 'login.html') @auth_bp.route('/logout') async def logout(req): return redirect('/') # Register in app.py app.register_blueprint(auth_bp)
Built-in form handling with validation:
from jsweb.forms import Form, StringField from jsweb.validators import DataRequired, Email class LoginForm(Form): email = StringField("Email", validators=[DataRequired(), Email()]) password = StringField("Password", validators=[DataRequired()]) @app.route("/login", methods=["GET", "POST"]) async def login(req): form = LoginForm(await req.form()) if form.validate(): # Handle login pass return render(req, "login.html", {"form": form})
Define models with SQLAlchemy:
from jsweb.database import ModelBase, Column, Integer, String class User(ModelBase): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String(80), unique=True, nullable=False) email = Column(String(120), unique=True, nullable=False) # Query the database user = User.query.get(1) users = User.query.all() new_user = User.create(username="john", email="john@example.com")
Auto-generated admin interface:
from jsweb.admin import Admin admin = Admin(app) admin.register(User) admin.register(Post) admin.register(Category) # Access at http://localhost:8000/admin
- π Documentation - jsweb-framework.site
- π¬ Discord - Join community
- π Issues - Report bugs
- π‘ Questions & Discussions - Discord Community
- π GitHub - Jsweb-Tech/jsweb
We welcome contributions from the community! Whether you want to fix a bug, add a feature, or improve documentation:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
See Contributing Guide for details.
- Status: Active Development
- Python: 3.8+
- License: MIT
- Latest Version: Check PyPI
This project is licensed under the MIT License - see LICENSE file for details.
Made and Maintained by the JsWeb team
Join our Discord community β’
Sponsor us