#admin.py:
from apps.<appname>.models import Articles, Sections
ImportError: No module named <appname>.models
I have seen this error before, and it went away when I changed INSTALLED APPS from <appname> to apps.<appname> because I have all my apps in a folder called apps. Now I have changed even that to <appname>Config because of the 1.7 change to how this works. Apps.py is two levels down from here, so I don’t think there is a collision issue.
I tried changing the import statement to match the <appname>Config in INSTALLED APPS, but that just gave me the same error with the *Config name instead.
This is my model, it is clearly there, so I don’t know why or where this error is coming from or where to look to fix it. <appname> is all lower case, both in the Django directory and in admin.py. Just for the hell of it I capitalized <Appname> in admin.py, but I still get the same error.
What is “.models”, why and when do we import from it, and how is it different from importing from “models”?
I’ve never seen this .models before. I saw it the first time this morning in the documentation https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.register when trying to solve this problem. But it just a casual mention, not an explanation. As I understood it, this was only for those choosing to use the new register decorator, so I didn’t worry about it. Now I’ve seen it again, in a video by a guy using 1.6 who, at least so far, has made no reference to a decorator of any kind.
Is this the source of my problems? Where is the documentation on “.models”? Yes, I have looked and found zip.
Thanks.