page:guides:django:cdn assets
Deliver public assets through CDN for Django
Summary
Cdn assets for a Django app on Ample. Verified on Django: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: pip install into .ample/python from requirements.txt, then waitress serving project.wsgi from run.py reading PORT on the python-3.12 template.
Resource Requirements
- Compute
Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes. - CDN
The CDN host serves objects from published buckets. It does not front app compute and is not a cache or key-value store.
Prerequisites
- A Django project (pip install into .ample/python from requirements.txt, then waitress serving project.wsgi from run.py reading PORT on the python-3.12 template)
- A bucket from
ample bucket createwith credentials passed as encrypted S3_* environment variables - An Ample account token with servers:write, buckets:read
Workflow Steps
- Build and start
pip install into .ample/python from requirements.txt, then waitress serving project.wsgi from run.py reading PORT on the python-3.12 template; the server must bind 0.0.0.0 on PORT. - Publish a bucket for public assets
Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.
Command:ample bucket publish - Verify
Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.
Command:ample logs --kind build
Success Checks
- app responds on its public URL
- versioned-static-assets check from the example
Limitations
- Verified on the python-3.12 template at s-1vcpu-1gb; other sizes and Django major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
Cost Estimate
- Currency: USD
- Monthly Amount: 5.0
- Basis: size prices from pricing.toml