title: how does django `makemigrations` work under the hood?
body: <p>My question is: what does calling <code>manage makemigrations</code> actually do? </p>
  
  <p>I know it creates migration files, but how? How does it keep track of what changed since last migration? Does it directly compare the current status of the models to the database? Does it keep some hidden files describing the previous status? Which part of the framework code does it call? The documentation says nothing on the subject. </p>