title: Error in importing model in django
body: <p>Error in importing model in another file. Basically I want to use </p>
  
  <pre><code>&gt;&gt;&gt; from mysite.blog.models import Blog
  &gt;&gt;&gt; b = Blog(name='Beatles Blog', tagline='All the latest Beatles news.')
  &gt;&gt;&gt; b.save()
  </code></pre>
  
  <p>but in a python file[ scrap.py ] to add values to models but error is on import of models in this file . any help ??</p>
  
  <pre><code>from models import QuestionBox  // Error in this line
  </code></pre>
  
  <p>Error Traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "scrap.py", line 1, in &lt;module&gt;
      from models import QuestionBox
    File "/home/sourabh/Django/QASite/QAsite/QAapp/models.py", line 1, in &lt;module&gt;
      from django.db import models
    File "/home/sourabh/Django/QASite/local/lib/python2.7/site-packages/django/db/__init__.py", line 11, in &lt;module&gt;
      if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
    File "/home/sourabh/Django/QASite/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
      self._setup(name)
    File "/home/sourabh/Django/QASite/local/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in _setup
      % (desc, ENVIRONMENT_VARIABLE))
  django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
  </code></pre>
  
  <p>Dir Tree</p>
  
  <pre><code>    .
      |-- manage.py
      |-- QAapp
      |   |-- __init__.py
      |   |-- __init__.pyc
      |   |-- migrations
      |   |   |-- 0001_initial.py
      |   |   |-- 0001_initial.pyc
      |   |   |-- 0002_initial.py
      |   |   |-- 0002_initial.pyc
      |   |   |-- 0003_initial.py
      |   |   |-- 0003_initial.pyc
      |   |   |-- __init__.py
      |   |   `-- __init__.pyc
      |   |-- models.py
      |   |-- models.pyc
      |   |-- scrap.py
      |   |-- tests.py
      |   `-- views.py
      |-- QAappdb
      `-- QAsite
          |-- __init__.py
          |-- __init__.pyc
          |-- settings.py
          |-- settings.pyc
          |-- urls.py
          `-- wsgi.py
  </code></pre>
  
  <p>model file:</p>
  
  <pre><code>class QuestionBox :
  
      topic = models.CharField(max_length=50)
      sub_topic = models.CharField(max_length=50)
  
      question = models.TextField()
      options = models.TextField()
      correct_option = models.TextField()
  
      total_attempt = models.IntegerField()
      correct_attempt = models.IntegerField()
  </code></pre>