On Wed, Aug 10, 2011 at 3:17 PM, Kayode Odeyemi <drey...@gmail.com> wrote:
> Hello friends,
> I need some help on how to pass url parameters to template url tag.
> Something like this:
> <a href="{% url reverse-url-fn request.GET.get('page', '')%}">my page</a>
> page is the url parameter I want to get
> Thank you

You have two options:

you can extract the value in the view, and put it into the context
that is used to render the template.

you can access it using dot notation [1], which is used in templates
(templates are not python, you cannot write python in templates). Eg:
{% url url-name request.GET.page %}

Cheers

Tom

[1] https://docs.djangoproject.com/en/1.3/topics/templates/#variables

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