Re: Named URLs Error
Not sure but I think you have to put {% load tags %} in your template.
On Nov 24, 2011, at 6:07 , eeyore 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.
>
>
> /urls.py
> ----------------------------------------------------------------------------------
> urlpatterns = patterns('',
> (r'^products/', include('products.urls')),
> )
>
> /products/urls.py
> ----------------------------------------------------------------------------------
> from django.conf.urls.defaults import patterns, url
>
> urlpatterns = patterns('products.views',
> url(r'^$', view="index", name="products_index"),
> )
>
> /templates/products/index.html
> ----------------------------------------------------------------------------------
> <a href="{% url products_index %}"> Products </a>
>
> Error
> ----------------------------------------------------------------------------------
> In template /home/user/app/templates/inc/header.html, error at line 18
> Caught ImportError while rendering: No module named urls
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home