True hot reload for Django and Python web frameworks β no server restart needed.
superreload watches your Python files and automatically reloads modules when they change, then refreshes your browser via WebSocket. This dramatically speeds up the development feedback loop.
- Instant reload: Python modules reload without restarting the server
- Browser auto-refresh: WebSocket-based browser refresh on file changes
- CSS hot reload: Stylesheets update without page refresh
- Error overlay: Beautiful error display with stack traces and local variables
- Keyboard shortcuts: Manual reload via Ctrl+Shift+R (browser) or 'r' + Enter (console)
- Django-first: Deep Django integration with view, template, and URL cache clearing
- Script mode: Run any Python script with hot reloading via CLI
- Gitignore support: Automatically exclude files matching
.gitignorepatterns - Extensible: Framework-agnostic core with pluggable framework adapters
- Zero config: Works out of the box with sensible defaults
pip install superreload[django]Or with uv:
uv add superreload[django]# settings.py
INSTALLED_APPS = [
# ...
'superreload.frameworks.django',
# ...
]# settings.py
MIDDLEWARE = [
'superreload.frameworks.django.SuperReloadMiddleware',
# ... other middleware
]python manage.py superreloadOr with an address:
python manage.py superreload 0.0.0.0:8000That's it! Edit any Python, HTML, CSS, or JS file and watch your browser update automatically.
- File Watcher: Monitors your project for
.py,.html,.css,.jschanges - Module Reloader: Intelligently reloads changed Python modules and their dependents
- WebSocket Server: Notifies connected browsers to refresh
- Middleware: Injects a tiny JavaScript client into HTML responses
- CSS Hot Reload: Swaps stylesheets without full page refresh
- Error Overlay: Shows reload errors with full stack traces in the browser
Default is localhost:9877. Change it via:
python manage.py superreload --ws-host 0.0.0.0:9999Default path is /superreload. Useful for Docker/reverse proxy setups:
python manage.py superreload --ws-path /my-custom-pathRun without hot reloading:
python manage.py superreload --no-reloadTrigger a manual reload at any time:
- Browser: Press
Ctrl+Shift+R(orCmd+Shift+Ron Mac) - Console: Press
r+Enterin the terminal running superreload
The middleware only activates when DEBUG = True. In production, it does nothing.
Run any Python script with hot reloading (no framework required):
superreload run script.pyBy default, superreload uses jurigged for surgical code patching - your functions and classes are updated in-place while preserving state.
# Watch additional directories
superreload run script.py --watch src/ --watch lib/
# Watch project, respecting .gitignore
superreload run script.py --watch . --gitignore# Default: jurigged (surgical patching, preserves state)
superreload run script.py
# Simple mode: re-execute on change (no state preservation)
superreload run script.py --simple
# Full restart: restart process on any change
superreload run script.py --full-reloadsuperreload run server.py -- --port 8080 --debug| Mode | Behavior | State Preserved |
|---|---|---|
| Default (jurigged) | Surgical code patching | Yes |
--simple |
Re-execute script | No |
--full-reload |
Process restart | No |
- β Django (4.2+)
- π Flask (coming soon)
- π FastAPI (coming soon)
- Python 3.9+
- Django 4.2+ (for Django integration)
# Clone the repo
git clone https://github.com/aareman/superreload.git
cd superreload
# Install dependencies
uv sync --dev
# Run tests
uv run pytest
# Lint
uv run ruff check src tests
# Type check
uv run mypy srcsuperreload/
βββ cli.py # CLI entry point ('run' command)
βββ core/
β βββ errors.py # Error formatting with local variables
β βββ framework.py # Base framework abstraction
β βββ gitignore.py # Parse .gitignore files for filtering
β βββ reloader.py # Python module reloading
β βββ script_runner.py # Run scripts with hot reload/restart
β βββ watcher.py # File system watching
β βββ websocket.py # WebSocket server
βββ frameworks/
βββ django/
βββ framework.py # Django-specific reload logic
βββ middleware.py # Auto-inject JS client + error overlay
βββ reload_server.py # Orchestrates everything
MIT License - see LICENSE for details.
Contributions welcome! See CONTRIBUTING.md for guidelines.