Installation
Installation
Section titled “Installation”Zenith is a batteries-included Python web framework that comes with everything you need to build production APIs.
Quick Install
Section titled “Quick Install”pip install zenithweb
# Verify installationzen --versionWhat’s Included
Section titled “What’s Included”Zenith bundles commonly needed dependencies so you can start building immediately:
Database & ORM
- SQLAlchemy 2.0+ with async support
- SQLModel for type-safe models
- PostgreSQL driver (asyncpg)
- SQLite driver (aiosqlite)
- Alembic for migrations
Authentication & Security
- JWT libraries (PyJWT)
- Password hashing (Argon2 via pwdlib)
- Security headers middleware
Performance & Caching
- Redis client for caching
- JSON serialization (orjson, msgspec)
- Performance monitoring (prometheus-client)
- Async server (uvicorn)
Development Tools
- WebSocket support
- File upload support (python-multipart)
- Testing utilities
- CLI tools
Requirements
Section titled “Requirements”- Python 3.12-3.13
- pip or uv package manager
- PostgreSQL or SQLite for database (optional)
- Redis for caching and background tasks (optional)
Installation Methods
Section titled “Installation Methods”Using pip
Section titled “Using pip”The standard Python package manager:
# Install Zenithpip install zenithweb
# Create your first projectzen new my-apicd my-api
# Start development serverzen devUsing uv (Recommended)
Section titled “Using uv (Recommended)”uv is a fast, modern Python package manager:
# Install uv if you haven'tcurl -LsSf https://astral.sh/uv/install.sh | sh
# Install Zenithuv add zenithweb
# Run with uvuv run zen devUsing Poetry
Section titled “Using Poetry”For projects that use Poetry for dependency management:
# Add to your projectpoetry add zenithweb
# Run commandspoetry run zen devInstallation Options
Section titled “Installation Options”| Method | Best For | Key Benefit |
|---|---|---|
| pip | Quick start, tutorials | Universal, works everywhere |
| uv | Modern development | 10-100x faster installs |
| Poetry | Team projects | Lock files, reproducible builds |
| Docker | Microservices | Consistent environments |
Optional Extras
Section titled “Optional Extras”Install additional features as needed:
# Development tools (testing, linting)pip install "zenithweb[dev]"
# Performance benchmarkingpip install "zenithweb[benchmark]"
# Additional performance optimizationspip install "zenithweb[performance]"
# HTTP/3 supportpip install "zenithweb[http3]"
# Advanced compressionpip install "zenithweb[compression]"Environment Setup
Section titled “Environment Setup”Virtual Environment (Recommended)
Section titled “Virtual Environment (Recommended)”# Create virtual environmentpython -m venv venv
# Activate itsource venv/bin/activate # On Windows: venv\Scripts\activate
# Install Zenithpip install zenithwebEnvironment Variables
Section titled “Environment Variables”Create a .env file for your configuration:
# DatabaseDATABASE_URL=postgresql://user:password@localhost/zenith_dev
# Redis (optional)REDIS_URL=redis://localhost:6379
# SecuritySECRET_KEY=your-secret-key-here
# EnvironmentDEBUG=trueENVIRONMENT=developmentDocker Setup
Section titled “Docker Setup”For containerized development:
version: '3.8'
services: postgres: image: postgres:15 environment: POSTGRES_USER: zenith POSTGRES_PASSWORD: zenith POSTGRES_DB: zenith_dev ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data
redis: image: redis:7-alpine ports: - "6379:6379"
volumes: postgres_data:Start services:
docker-compose up -dVerify Installation
Section titled “Verify Installation”After installation, verify everything works:
# Check CLIzen --version
# Check Python importpython -c "import zenith; print(zenith.__version__)"
# Create test projectzen new test-projectcd test-project
# Run development serverzen dev
# Visit http://localhost:8000IDE Setup
Section titled “IDE Setup”VS Code
Section titled “VS Code”Install recommended extensions for the best experience:
{ "recommendations": [ "ms-python.python", "ms-python.vscode-pylance", "ms-python.black-formatter", "charliermarsh.ruff", "tamasfe.even-better-toml" ]}PyCharm
Section titled “PyCharm”- Set Python interpreter to your virtual environment
- Enable type checking in settings
- Configure Black as the code formatter
Production Setup
Section titled “Production Setup”# Install with production optimizationspip install "zenithweb[performance]"
# Set production environment variablesexport DATABASE_URL=postgresql://...export REDIS_URL=redis://...export SECRET_KEY=$(zen keygen)export DEBUG=false
# Run with production serverzen serve --workers 4Troubleshooting
Section titled “Troubleshooting”Import Errors
Section titled “Import Errors”- Ensure Python 3.12-3.13 is being used
- Check virtual environment is activated
- Reinstall:
pip install --force-reinstall zenithweb
Command Not Found
Section titled “Command Not Found”- Check if
zenis in your PATH - Try
python -m zenith.cliinstead - Ensure virtual environment is activated
Port Already in Use
Section titled “Port Already in Use”- Stop other processes:
lsof -i :8000 - Use different port:
zen dev --port 8001
Next Steps
Section titled “Next Steps”- Quick Start Guide - Build your first API
- Project Structure - Understand the layout
- Tutorial - Step-by-step learning