title: Python Flask give argument to url
body: <p>How can I pass the id of my event object.</p>
  <pre><code> &lt;div class=&quot;row&quot;&gt;
       {% for event in events %}
      &lt;div class=&quot;col&quot;&gt;
  &lt;div class=&quot;card&quot; style=&quot;width: 18rem;&quot;&gt;
    &lt;img src=&quot;https://tailwindcss.com/img/card-top.jpg&quot; class=&quot;card-img-top&quot; alt=&quot;...&quot;&gt;
    &lt;div class=&quot;card-body&quot;&gt;
      &lt;h5 class=&quot;card-title&quot;&gt;{{event['title']}}&lt;/h5&gt;
      &lt;p class=&quot;card-text&quot;&gt;{{event['description']}}&lt;/p&gt;
        &lt;h10 class=&quot;card-title&quot;&gt;Start date: {{event['date']}}&lt;/h10&gt;
      &lt;a href=&quot;/participate/{event['id']}&quot; class=&quot;btn btn-primary&quot;&gt;Participate&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
      &lt;/div&gt;
      {% endfor %}
  </code></pre>
  <p>With my python code i try to get the id from the button.
  My python code:</p>
  <pre><code>@app.route(&quot;/participate/&lt;id&gt;&quot;)
  def participate(id):
      if session.get(&quot;email&quot;):
          print(id)
          mail = setupMail()
  
  
          return redirect(url_for(&quot;home&quot;))
      else: return redirect(url_for(&quot;login&quot;))
  </code></pre>