from books.models import Publisher etc
If that stops it working you need to look at your Python path. Make sure
/path/to/mysite is on the pythonpath. Also check that you have
__init__.py in each of the sub-directories.
hth
Mike
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Jn_07ca2t6MJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@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 view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Jn_07ca2t6MJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
If you really wanted to do relative imports, then I would use (for newer
python versions (>= 2.5)
# must be at the beginning of your python file
# the define will avoid any accidental relative imports
from __future__ import absolute_import
afterwards you can 'explicitely perform a relative import with'
from .models import Publisher, Book, Author # note the '.' before models