title: Django: Model.objects.get fails with ImportError exception
body: <p>I've model which represents settings in my system and I use it from another part of my application so that import has 3 levels <code>WORKING CODE &lt;- Module &lt;- Model</code></p>
  
  <p>Model <code>Variables</code></p>
  
  <pre>
  <code>
  
  from django.db import models
  
  class Variables(models.Model):
      key = models.CharField(max_length = 20, verbose_name = 'Variable')
      value = models.CharField(max_length = 1024)
  
      class Meta:
          app_label = 'core'
  
      def __unicode__(self):
          return '%s: %s' % (self.key, self.value,)
  </code>
  </pre>
  
  <p>Here is the code I'm using it from</p>
  
  <p>Module <code>variables.py</code></p>
  
  <pre>
  <code>
  
  from core.models.storage import Variables
  
  def get_var(name):
    return Variables.objects.get(key = name)
  </code>
  </pre>
  
  <p>Module <code>config.py</code></p>
  
  <pre>
  <code>
  
    var = get_var('some_key')
  </code>
  </pre>
  
  <p>When I use this stuff from django shell everything works well but when I call <code>get_var</code> function I've <code>ImportError</code> exception</p>
  
  <p><code>storage.py</code></p>
  
  <pre>
  <code>
  
  from django.db import models
  
  class Variables(models.Model):
      key = models.CharField(max_length = 20, verbose_name = 'Variable')
      value = models.CharField(max_length = 1024)
  
      class Meta:
          app_label = 'core'
  
      def __unicode__(self):
          return '%s: %s' % (self.key, self.value,)
  </code>
  </pre>
  
  <pre>
  <code>
  
    File "monitor_cli.py", line 19, in 
      print worker.get_provider()
    File "/home/sultan/Project/monitor/app/worker.py", line 14, in get_provider
      print Variables.objects.get(pk=1)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 132, in get
      return self.get_query_set().get(*args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 341, in get
      clone = self.filter(*args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 550, in filter
      return self._filter_or_exclude(False, *args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 568, in _filter_or_exclude
      clone.query.add_q(Q(*args, **kwargs))
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 1172, in add_q
      can_reuse=used_aliases, force_having=force_having)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 1060, in add_filter
      negate=negate, process_extras=process_extras)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 1226, in setup_joins
      field, model, direct, m2m = opts.get_field_by_name(name)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 307, in get_field_by_name
      cache = self.init_name_map()
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 337, in init_name_map
      for f, model in self.get_all_related_m2m_objects_with_model():
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 414, in get_all_related_m2m_objects_with_model
      cache = self._fill_related_many_to_many_cache()
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/options.py", line 428, in _fill_related_many_to_many_cache
      for klass in get_models():
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 167, in get_models
      self._populate()
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 61, in _populate
      self.load_app(app_name, True)
    File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 76, in load_app
      app_module = import_module(app_name)
    File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
      __import__(name)
  ImportError: No module named c
  </code>
  </pre>