title: How to manage.py loaddata in Django
body: <p>I've being fighting with this command for several hours now. </p>
  
  <p>If I do</p>
  
  <pre><code>python manage.py dumpdata --natural-foreign --&gt; data.json
  </code></pre>
  
  <p>when I loaddata I get the error</p>
  
  <blockquote>
    <p>Could not load contenttypes.ContentType(pk=19): duplicate key value
    violates unique constraint
    "django_content_type_app_label_76bd3d3b_uniq" DETAIL:  Key (app_label,
    model)=(misuper, stockitem) already exists.</p>
  </blockquote>
  
  <p>Then if I do</p>
  
  <pre><code>python manage.py dumpdata --natural-foreign --exclude=contenttypes --&gt; data.json
  </code></pre>
  
  <p>I get a similar error but with a ̣<code>auth.Permission</code> object:</p>
  
  <blockquote>
    <p>Could not load auth.Permission(pk=55): duplicate key value violates
    unique constraint "auth_permission_content_type_id_01ab375a_uniq"</p>
  </blockquote>
  
  <p>And if I do</p>
  
  <pre><code>python manage.py dumpdata --natural-foreign --exclude=contenttypes --exclude=auth --&gt; data.json
  </code></pre>
  
  <p>when I loaddata I get </p>
  
  <blockquote>
    <p>User matching query does not exist</p>
  </blockquote>
  
  <p>Of course, I'm excluding the auth table.</p>
  
  <p>So ... WTF can I do to load the data? All my tests depend on this.</p>
  
  <p>I believe the docs are insufficient. I'm stuck here, please help.</p>