title: Use Django ORM as standalone
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/302651/use-only-some-parts-of-django">Use only some parts of Django?</a><br>
    <a href="https://stackoverflow.com/questions/579511/using-only-the-db-part-of-django">Using only the DB part of Django</a></p>
  </blockquote>
  
  <p>I want to use the Django ORM as standalone. Despite an hour of searching Google, I'm still left with several questions:</p>
  
  <ul>
  <li>Does it require me to set up my Python project with a setting.py, /myApp/ directory, and modules.py file?</li>
  <li>Can I create a new <code>models.py</code> and run <code>syncdb</code> to have it automatically setup the tables and relationships or can I only use models from existing Django projects?</li>
  <li>There seems to be a lot of questions regarding <code>PYTHONPATH</code>. If you're not calling existing models is this needed?</li>
  </ul>
  
  <p>I guess the easiest thing would be for someone to just post a basic template or walkthrough of the process, clarifying the organization of the files e.g.:</p>
  
  <pre><code>db/
     __init__.py
     settings.py
     myScript.py
  orm/
     __init__.py
     models.py
  </code></pre>
  
  <p>And the basic essentials:</p>
  
  <pre><code># settings.py
  from django.conf import settings
  
  settings.configure(
       DATABASE_ENGINE   = "postgresql_psycopg2",
       DATABASE_HOST     = "localhost",
       DATABASE_NAME     = "dbName",
       DATABASE_USER     = "user",
       DATABASE_PASSWORD = "pass",
       DATABASE_PORT     = "5432"
  )
  
  # orm/models.py
  # ...
  
  # myScript.py
  # import models..
  </code></pre>
  
  <p>And whether you need to run something like: <code>django-admin.py inspectdb</code> ...</p>
  
  <p>(Oh, I'm running Windows if that changes anything regarding command-line arguments.).</p>