no module name.models

21 views
Skip to first unread message

Kakar Arunachal Service

unread,
May 18, 2013, 3:40:46 PM5/18/13
to django...@googlegroups.com
I'm practicing from a book Begining django e-commerce and m stuck in one place. My project name is ecomstore, and in it i have two app, one is preview and the other is catalog. In my preview app, there's just html in the templates dir, and thats not the problem, because the result was fine when i ran the server. And then i made a new app, catalog. It has two models, Category and Product. Then to register it with the admin, i made one admin.py file. And there i imported those two module by:
from django.contrib import admin
from django.ecomstore.catalog.models import Category, Product
...and some other forms related import.
Then when i run the server, i get an Import error: No module named catalog.models.
I have installed my app in settings.py.  Hope u guys could solve my problem.

Artem Zinoviev

unread,
May 19, 2013, 3:02:48 AM5/19/13
to django...@googlegroups.com
try:
    from ecomstore import Category, Product
this also can help http://stackoverflow.com/questions/6508545/importerror-no-module-named-models 

суббота, 18 мая 2013 г., 22:40:46 UTC+3 пользователь Kakar написал:

Kakar Arunachal Service

unread,
May 19, 2013, 7:25:49 AM5/19/13
to django...@googlegroups.com
Thanks! But i gt d solution, i just had to import catalog.models, as it was in my project folder. Thanks by d way!
Reply all
Reply to author
Forward
0 new messages