Image
cpsl.Image defines the runtime environment for your app. If the app needs Python packages, system packages, or setup commands, this is where they go.
Worked example
This is a realistic app-level deployment config:Constructor
Methods
| Method | Purpose |
|---|---|
add_python_packages(packages) | Add Python packages or load from a requirements file |
add_apt_packages(packages) | Add apt packages |
add_commands(commands) | Add shell commands to run during setup |
python_packages can be a list or a path to requirements.txt.
Theme
Configure app branding with app.theme(...).
Most apps do not need a fully custom theme. A preset plus a few overrides is usually enough:
Presets
Built-in presets:darklightmidnightwarm
Common theme fields
| Field | Meaning |
|---|---|
preset | Starting palette |
logo | Path or URL to a logo |
logo_background | Background behind the logo |
tagline | Sidebar subtitle |
primary | Main interactive color |
accent | Accent color |
background | Page background |
foreground | Main text color |
sidebar | Sidebar background |
surface | Cards and panels |
border | Borders and dividers |
muted | Secondary text |
danger | Error/destructive color |
success | Success color |
font_sans | Body font family |
font_mono | Code/data font family |
radius | sm, md, or lg |
FileSystem
Use cpsl.FileSystem("name") to mount named durable storage into the runtime:
Deployment-related app knobs
Pricing
Capsule uses cents for pricing:one_timemonthly
Warm runtimes
Secrets and filesystems
These are deployment config, not runtime afterthoughts:Class-based deploy config
For class-based apps, the deploy-specific knobs live on@app.cls(...) instead of the App(...) constructor: