cant properly import module


09:11 ~/rssDj/rssReader $ python
Traceback (most recent call last):
  File "", line 21, in <module>
    from models import FreqWord, WordIds, PrimaryData
  File "/home/kernie_xvid/rssDj/rssDjApp/", line 3, in <module>
    class FreqWord(models.Model):
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.3-py2.7.egg/django/db/models/", line 52, in __new__
    kwargs = {"app_label": model_module.__name__.split('.')[-2]}
IndexError: list index out of range

code of script:

...some imports...
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from models import FreqWord, WordIds, PrimaryData

code of models:

from django.db import models

class FreqWord(models.Model):
    word = models.CharField(max_length=64)
    freq = models.IntegerField()
    wordId = models.CharField(max_length=64)
    checkDate = models.DateTimeField()

et c.

Hi kernie_xvid,

That's an unusual one! Could you try only adding /home/kernie_xvid/rssDj and then doing your import line like this:

from rssDjApp.models import FreqWord, WordIds, PrimaryData

In how have you added rssDjApp? Did you add it as 'rssDjApp' or 'rssDj.rssDjApp'? If the first suggestion doesn't do anything you could try changing that. It seems like django is confused by your directory structure in some way.

solved, thankyou; in there was 'rssDj.rssDjApp', now its 'rssDjApp';