Try: from webservices.reviewsapp.models import Category
Bill On Thu, Mar 17, 2011 at 1:44 PM, Ricardo F. Teixeira <ricardo.tei...@gmail.com> wrote: > Hi list : ) > > I'm having a strange problem. I'm developing a webservice that > communicate with a database. > In my views.py file I'm trying to import models.py to manage some > queries but I got an error in views.py when I import models.py. > > ricardo@vulcanus:~/webservices/reviewsapp$ python views.py > Traceback (most recent call last): > File "views.py", line 13, in <module> > from reviewsapp.models import Category > ImportError: No module named reviewsapp.models > > ricardo@vulcanus:~/webservices/reviewsapp$ ls models.py > models.py > > In settings.py I have: > INSTALLED_APPS = ( > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.messages', > 'webservices.reviewsapp', > ) > > So in theory this should work, and I can(!) but only in django shell. > > ricardo@vulcanus:~/webservices/reviewsapp$ python ../manage.py shell > In [1]: from reviewsapp.models import * > > In [2]: C > Category Contrib ContribComment ContribReleases > ContribRoles ContribVersions > > And it shows my model. > > What I'm doing wrong here? > > Thanks, > > Ricardo F. Teixeira > > > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.