Sunday, August 7, 2011

Re: how to use "{% url *** %}" in django template file?

You can add name to the url in the urlpatterns:

urlpatterns = patterns('',
url(r'card/create$', 'card.views.create_card',
name='card_create_card'),
)

and call it in the template:

{% url card_create_card %}

On Aug 7, 1:05 pm, Jimmy <jimmy.don.k...@gmail.com> wrote:
> Hi,
>
> I got the error "Caught ImportError while rendering: No module named
> urls" when using:
>
> {% url 'card.views.create_card' %} in the template file
>
> in the urls.py the route to the url is:
>
> urlpatterns = patterns('',
>    url(r'card/create$', 'card.views.create_card'),
> )
>
> The Django version I use is 1.3
>
> May I know what did I miss in setting?

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


Real Estate