Tom,

1) The 'product' directory is not a module itself - it has no
__init__.py

The 'product' directory has __init.__.py

2) You have two modules called 'product', and it is attempting to
import urls from the 'wrong one'.

I created a new app with only one module to test it.

"from product.urls import urlpatterns"

Returns no errors.

Matt


On Nov 24, 7:46 am, Tom Evans <tevans...@googlemail.com> wrote:
> On Thu, Nov 24, 2011 at 5:07 AM, eeyore <maxtie...@gmail.com> wrote:
> > This seems like a very simple problem but I can't figure out why it
> > doesn't work.
>
> > What I am trying to do is to link to a particular view via a named
> > url.
> >....
>
> > Error
> > ----------------------------------------------------------------------------------
> > In template /home/user/app/templates/inc/header.html, error at line 18
> >   Caught ImportError while rendering: No module named urls
>
> Ivo: I don't think it is relevant what is in the template.
>
> This error says that it could not import a module named urls. Since in
> your root urlconf you tell it to load 'product.urls', I would imagine
> the problem is that Django cannot import the 'urls' module from
> 'product'. I can think of a couple of possible issues (there may be
> others!):
>
> 1) The 'product' directory is not a module itself - it has no __init__.py
> 2) You have two modules called 'product', and it is attempting to
> import urls from the 'wrong one'.
>
> Is it one of those errors, or do we need to keep digging? What happens
> if you load up a django shell (python manage.py shell) and import
> product.urls directly there ("from product.urls import urlpatterns").
> What error does that show?
>
> Cheers
>
> Tom

-- 
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.

Reply via email to