Re: How to send parameters in url tag?

2016-09-20 Thread Ares Ou
Hi, 

You have to use a form of keyword arguments to provide parameters in {% url 
%} tag.

For example,

{% url post_view post_id=post_id %}

the former post_id is the argument name in your view function, the latter 
post_id is the variable name in your template context.

If you have more than one parameters, just append them to the list, 
separated by a space:

{% url post_view post_id=post_id tag='post tag' %}

On Tuesday, September 20, 2016 at 3:51:56 AM UTC-7, Za Ars wrote:
>
> Hou to send parameters in url as string?
>
> {%url url_name url_params%}
>
> where url_params as 'pk=object.id' or 'page=page.number'
>
>
> Please, help me, if you can
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d151994f-fd84-4137-a2d7-163839c264cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to send parameters in url tag?

2016-09-20 Thread Alessandro Madruga Correia
>
> {%url url_name url_params%}
>
> where url_params as 'pk=object.id' or 'page=page.number'
>

Here have an example
https://docs.djangoproject.com/en/1.10/topics/http/urls/#reverse-resolution-of-urls


-- 
  ,= ,-_-. =.   [] Alessandro Madruga Correia
 ((_/)o o(\_))  [http://counter.li.org]   Debian User# 342751
   `-'(. .)`-'"O fanatismo é a única forma de força de vontade
   \_/acessível aos fracos." (Friedrich Nietzsche)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOofabfH%3DM7Mcrcr7nOTPkwztut1s8uDFATGm_7V8zJX5wEbmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.