Auto-generating an API using PostgreSQL, Django, and Django REST Framework
summary
Auto-generating an API from PostgreSQL with Django and Django REST Framework uses information_schema introspection to inspect schemas, meta-programming to do meta-programming model generation that creates Django models/serializers/filtersets/viewsets, and a dbt added PK trick to satisfy Django primary key requirements. Performance fixes include a conditional count pagination to avoid slow COUNTs on millions of rows. The system runs in production for years serving hundreds to thousands of tables, but struggles with PostGIS types, rich foreign‑key relationships, and rapidly changing client‑visible schemas.
AI-written summary · about
chapters (16)
- 0:00Start
- 11:18Inspecting the Database
- 11:29Introspection
- 12:05Information Schema
- 18:33Introduction to Meta Programming
- 20:35Meta Programming
- 24:23Primary Keys
- 27:49Django Filters
- 29:35View Sets
- 30:46Browsable Api
- 32:29Meta Classes
- 33:31Permissions
- 34:00Django Rest Frameworks Permission
- 35:29Pagination
- 36:30Pagination Class
- 37:57Custom Paginator
related talks
23mDjango with PostgreSQL superpowers
27mDjango REST Framework: Taking your API to the next level
22mDjango with PostgreSQL superpowers
31mSpace Django: Migrating and Redesigning a Database while Hunting for Satellites.
27mBuilding a REST API with Django & Django REST Framework
24mOf Django, PostgreSQL schemas, and your multi-million dollar idea
21mBuilding Powerful APIs with Django, Django Rest Framework, and OpenAPI
26mPostgreSQL Generated Columns by Example
