title: AttributeError with django.setup()
body: <p>I am trying to create a population script following <a href="http://www.tangowithdjango.com/book17/chapters/models.html#creating-a-population-script" rel="nofollow">the instructions in the Tango with Django book</a>. The script is sited in the project root folder and starts with these lines:</p>
  
  <pre><code>import os
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pyguess.settings')
  import django
  django.setup()
  </code></pre>
  
  <p>But it fails to run, returning this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/desousa/djcode/pyguess/populate_core.py", line 5, in &lt;module&gt;
      django.setup()
  AttributeError: 'module' object has no attribute 'setup'
  </code></pre>
  
  <p>What is going wrong here? Is the <code>import django</code> instruction failing somehow?</p>