How Django Uses Python Properties and Descriptors

Yu Chen
18 min readMar 22, 2020

Before you continue reading: this is an intermediate-and-above level Python article. In order to fully engage with the concepts in this article, you’ll need to be familiar with basic Django concepts and have a solid grasp of Python’s object-oriented programming model. This article is a continuation our deep-dive from Part I: How Django Uses Metaclasses For Data Modelling.

In this article, we’ll specifically focus on Django’s use of Python properties and their lower-level descriptor implementations. If you’re not sure what either of these terms…

--

--

Yu Chen

Software engineer focused on ML and distributed systems