docs: add Django ORM ingestion scaffold#4
Conversation
|
@jo-basevi I think this is roughly the workflow you had in mind? I had my bot translate the straight to postgres worklow into something that we could post to tracking services and have handled there. Lemme know if this looks dumb as rocks to you/ isn't what you had in mind! (I mostly got it to write this to understand the idea better) |
|
Yeah I've only had a very quick read through and I think it matches up with what I was thinking - e.g. some django managed tables, a view for handling ingestion, and sending post requests to the API. |
|
Cool - I'll start turning this into something more workable then! |
|
@jo-basevi was just about to get to this, will it make most sense to branch off main in tracking services? My head is swimming with those merge problems 😆 |
|
Yeah, can branch off main for now. |
Summary
Adds a minimal Django scaffold for a possible HTTP + ORM ingestion path.
This does not replace the current direct-to-Postgres flow. It just captures the shape of a Django middle layer in one file so it can be copied into a Django app later.
Why
Charles asked whether we could put a Django service in the middle so telemetry could be POSTed to an endpoint, filtered/validated through ORM-backed models, and then written to the database.
Short answer: yes, that architecture is perfectly viable here.
What changed
django_scaffold.pywith:conda_env_sessions,conda_env_packages, andconda_env_ingest_runsingest_payloads()helper usingbulk_create(..., ignore_conflicts=True)ingest_telemetry_view()POST endpointScope / non-goals
Closes #3.
Validation
python3 -m py_compile django_scaffold.py