my problem is very similar with: http://groups.google.com/group/django-users/browse_frm/thread/43b3e6d2d0a691d/f2e05622f3aef6bb?lnk=gst&q=__main__+models&rnum=2#f2e05622f3aef6bb
but there i don't think someone had solved that question. so I just make that question simple. I have set environment vars of PYTHONPATH and DJANGO_SETTING_MODULE ( i am using windowsXP), and write a simple app as: from django.db import models class Friend(models.Model): name = models.CharField(maxlength=79) def names(): for friend in Friend.objects.all(): print friend.name if '__main__'==__name__: names() when running, there's error as: Traceback (most recent call last): File "D:/loc/loc/test.py", line 3, in ? class Friend(models.Model): File "D:\Python24\lib\site-packages\django-0.95-py2.4.egg\django\db\models\base.py", line 44, in __new__ new_class._meta.app_label = model_module.__name__.split('.')[-2] IndexError: list index out of range how to solve this problem? thanks. btw, after i post here, it always takes 1 to 2 days for me to see my post...so if u can't see my feedback, plz wait for some time. ;(( --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---