# Host admin dashboard with Django: tenant-scoped workspaces

Deploy an admin dashboard built with Django on Ample using the multi-tenant relational data pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Django: a tenant column on every row and query, with a cross-tenant read returning nothing (tenant_isolation=ok). Not separately tested: your tenant model, membership and per-tenant authorization; treat the admin dashboard-specific behavior as your application code.

## Summary
Deploy an admin dashboard with the following features:
- Framework: Django
- Workload: Admin dashboard

### Representative Queries
- Host admin dashboard with Django: tenant-scoped workspaces
- Where can I host Admin dashboard built with Django?
- I need an explicit tenant model and application-enforced tenant isolation tests.

## Resource Requirements
- **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request.
- **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned.

## Prerequisites
- A Django project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted).
- An Ample account token with appropriate permissions.

## Tested Configuration
- **Template**: python-3.12
- **Runtime**: python
- **Size**: s-1vcpu-1gb
- **Install Command**: `python3 -m pip install --target .ample/python -r requirements.txt`
- **Start Command**: `PYTHONPATH=.ample/python:${PYTHONPATH:-} python3 run.py`

## Workflow Steps
1. **Build and Start**: `pip install into .ample/python from requirements.txt`
2. **Implement the Pattern on PostgreSQL**: Use a tenant column for every row.
3. **Deploy**: Run the synchronous deploy and read the result with `ample deploy . --name  --public --start "python3 run.py"`.
4. **Verify**: Fetch the live URL and check for tenant isolation with `ample logs  --kind build`.

## Limitations
- Verified only on the python-3.12 template with the example fixture.
- The admin dashboard's tenant model and authorization require separate testing.

## Cost Estimate
- **Monthly Amount**: $10.00
- **Components**:
  - App server (s-1vcpu-1gb): $5.00
  - Managed PostgreSQL database (s-1vcpu-1gb): $5.00

## Evidence Summary
- **Django pattern fixture** deployed and verified for tenant isolation.
- **Passes checks** for multi-tenant relational data and configuration secrets.
