title: How to get the app a Django model is from?
body: <p>I have a model with a generic relation:</p>
  
  <pre><code>TrackedItem --- genericrelation ---&gt; any model
  </code></pre>
  
  <p>I would like to be able to generically get, from the initial model, the tracked item.</p>
  
  <p>I should be able to do it on any model without modifying it.</p>
  
  <p>To do that I need to get the content type and the object id. Getting the object id is easy since I have the model instance, but getting the content type is not: ContentType.object.filter requires the model (which is just <code>content_object.__class__.__name__</code>) and the app_label.</p>
  
  <p>I have no idea of how to get in a reliable way the app in which a model is.</p>
  
  <p>For now I do <code>app = content_object.__module__.split(".")[0]</code>, but it doesn't work with django contrib apps.</p>