# Photography studios: asset library using Django

## Summary
A asset library blueprint for photography studios built with Django on Ample.  
**Domain schema:**  
- **listings** (reference, session_type, price_from, publishing_status, agency_id): session packages with publishing status;  
- **agencies** (name, location, studio_count): studios or locations;  
- **galleries** (listing_id, object_key, cdn_key, consent_reference): published portfolio media;  
- **reports** (agency_id, period, object_key, generated_at): studio booking reports;  
- **uploads** (id, owner_reference, object_key, content_type, size, uploaded_at): validated uploads linked to their owner.

**Public information:** session packages and pricing from, consented portfolio galleries, studio locations.  
**Kept out of scope until handling is reviewed:** client galleries before release, minors in photographs, payment details. Client galleries are private until released with consent; only consented portfolio media is public.

**Technical basis verified on Django:** content-type and size validation that rejects disallowed files, an object written to a private bucket and a row linking the record to the object key (reject=ok upload=ok linked=ok).

## Representative Queries
- Photography studios: asset library using Django  
- Where can I host Photography studios: Asset library built with Django?  
- I need a genuinely specialized asset library workflow covering client galleries, usage permissions and original/derivative assets.

## Resource Requirements
- **Compute**  
- **Postgres**  
- **S3-compatible object storage**

## Infrastructure Requirements
1. **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
2. **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.
3. **S3-compatible object storage**: Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary. Other S3 operations are not verified.

## 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 PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)  
- Bucket credentials from `ample bucket create` passed as encrypted S3_* environment variables  
- A review of which photography studios data classes may be handled at all; this blueprint models public information only

## Workflow Steps
1. **Model the photography studios domain**: Create the tables listings, agencies, galleries, reports, uploads. Session packages with publishing status lives in listings; keep the sensitive classes (client galleries before release, minors in photographs, payment details) out of this schema.
2. **Workflow step 1**: Model assets linked to their owning group or workspace.
3. **Workflow step 2**: Validate uploads and store them in the private bucket; link each object to its row.
4. **Workflow step 3**: Authorize downloads by membership.
5. **Workflow step 4**: Deploy and verify rejection of disallowed files and a linked upload.
6. **Deploy**: Run the synchronous deploy once and read the result. Re-running with no change is a no-op.
7. **Verify**: Run the pattern self-test(s) from the example (/p/browser-file-uploads) and your own acceptance checks for the photography studios workflow.

## Limitations
- The technical basis (browser file uploads on Django) was verified with the pattern fixture; the photography studios schema and workflow are an original design for this blueprint and were not executed as a separate application.
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.

## Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 10.0  
- **Basis**: size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty  
- **Components**:  
  - **App server** (size: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0)  
  - **Managed PostgreSQL database** (size: s-1vcpu-1gb, quantity: 1.0, monthly amount: 5.0)  
- **Note**: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle. Buckets are allocation-priced per quota and not included.

## Success Checks
1. App responds on its public URL.  
2. Browser-file-uploads self-test from the example.

## Evidence Summary
- **Kind**: canary_run  
- **Summary**: Django pattern fixture deployed on Ample (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 browser file uploads checks passed.
- **Observed At**: 2026-09-20T03:31:44Z  
- **Scope**: {checks:[/p/browser-file-uploads], pattern:pattern:browser-file-uploads, template:python-3.12}

## Formats
- **HTML**: [Link](/content/blueprints/photography-studios/asset-library/django/index.html)  
- **Markdown**: [Link](/content/blueprints/photography-studios/asset-library/django.md)  
- **JSON**: [Link](https://api.ample.computer/v1/catalog/recipes/page%3Ablueprints%3Aphotography-studios%3Aasset-library%3Adjango)
