# Host admin dashboard with Django: private documents

## Summary

Deploy an admin dashboard built with Django on Ample using the private document library pattern. It runs the app in an isolated microVM behind a public HTTPS URL, with a managed PostgreSQL 16 database auto-provisioned as DATABASE_URL. A private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables. Verified on Django: a role-to-document access model with negative tests (401 without identity, 403 for the wrong role) and a private-bucket round-trip for the allowed role (private=ok).

## Infrastructure requirements

- Verified Compute: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request.
- Verified Postgres: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
- Verified S3-compatible object storage: Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary.

## Prerequisites

- A Django project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime.
- A bucket created from `ample bucket create` with its credentials passed as encrypted S3_* environment variables.
- An Ample account token with necessary permissions.

## Exact tested configuration

- template: `python-3.12`
- runtime: `python`
- size: `s-1vcpu-1gb`

## Steps

1. **Build and start.** Use the documented command to install the required packages and serve the project.
2. **Implement the pattern on PostgreSQL.** Use the role-to-document access model with necessary migration practices.
3. **Wire object storage.** Create the buckets and pass necessary environment values.
4. **Deploy.** Command to run the synchronous deploy and check the result.
5. **Verify.** Fetch the live URL and perform checks on the self-test route(s).

## Success checks

- App responds on its public URL.
- Private-document-library self-test expectations met.

## Limitations

- Verified only on the specific template at the specified size; does not cover all configurations.
- The dashboard behavior and identity integration are not separately tested.

## Cost estimate

Estimated 10.00 USD per month for the specified resources.

## Execution binding

Schema observed with required scopes for deployment.
