How can I make a link with parameter in Django tepmlates ?
I try to do something like
<a href="/member/profile/edit/code=" % {{ sal.id }}> Edit</a>
What is the best way to do this ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way of doin it:
But a preferred method is to use a URL tag.
where, in your
urls.pyyou have an entry with nameedit_profileYou can also, if you want, reverse the URLs in the model in a method, say
get_absolute_urland call that method, like:where, the said method is defined as follows: