PyCon Israel 2025

How to get Foreign Keys Horribly Wrong in Django
09-09, 15:00–15:20 (Asia/Jerusalem), Main Hall (30)
Language: עברית

In this talk I present some lesser known gotchas and implicit behaviors of Foreign Keys in Django. We'll talk on what you need to pay attention to when defining FKs, how to change FKs w/o bringing your system to a halt and how to optimize for space,


Not many know this, but Foreign Keys in Django has a lot more then meets the eye! In this talk we'll build a small Django app together and tackle many issues related to Foreign Keys in the process. We'll talk about indexes, safe migrations, concurrency and performance. We'll also explore some of Django's implicit behaviors and discuss when and how we can do better!


Expected experience level of participants

Intermediate

Target audience

Developers, R&D

Software developer and a technical lead. I take special interest in databases, web development, software design and performance tuning. More at https://hakibenita.com