# pass form value to url in template

**URL:** <https://forum.djangoproject.com/t/pass-form-value-to-url-in-template/29961>\
**Category:** Mystery Errors\
**Created:** [April 8, 2024, 3:14pm UTC](https://forum.djangoproject.com/t/pass-form-value-to-url-in-template/29961 "2024-04-08T15:14:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maeso2u](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/maeso2u/32/20469_2.png) [@maeso2u](https://forum.djangoproject.com/u/maeso2u)\
**Post date:** [April 8, 2024, 3:14pm UTC](https://forum.djangoproject.com/t/pass-form-value-to-url-in-template/29961/1 "2024-04-08T15:14:03Z")

</div>

Hi all  
I try to pass form value to url in html template as :  
a href=“{% url ‘addrealestatepic’ {{form1.identifier}} %}”

I send form value from view.py as :  
return render(request,‘realestate/addrealestate.html’,{‘form1’: form1,})  
I use url as : path(‘addrealestatepic/uuid:identifier/’,views.addrealestatepic,name=‘addrealestatepic’),

it give me error

what is the correct syntex ??

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 9, 2024, 3:20am UTC](https://forum.djangoproject.com/t/pass-form-value-to-url-in-template/29961/2 "2024-04-09T03:20:42Z")

</div>

You don’t need to enclose variables in `{{ }}` when using them in tags. The variable reference would just be `form1.identifier`.

Note: For future reference when asking about an error, please post the actual error message you are receiving, along with the traceback generated.
