logoalt Hacker News

zelphirkalttoday at 10:36 AM2 repliesview on HN

How do your API calls get into the Django app(s)? Do you define the API as well on the Django side (duplicating the API)? Or is there some tool that translates the Rust API calls for Django efficiently?


Replies

Klonoartoday at 11:42 AM

In practice, I've found you never want to be duplicating full models on the API side - you're only querying specific fields so you end up with custom/ad-hoc structs instead of ORM objects like you'd have in Django.

Just read from the database and treat Django as a DB builder/migrator/inspector.

tclancytoday at 11:40 AM

Going to guess they explicitly map the database tables (and do it all as read-only perhaps) to allow admins to view and report on data from the API.