title: How to pass parameters from my form action to a view? Django
body: <p>This is my view function: It takes one kwarg i.e block_id</p>
  
  <pre><code>def write_comment(request, block_id):
      block=get_object_or_404(Block, pk=block_id)
      if request.method=='POST':
          form=Comment_form(request.POST)
          if form.is_valid():
              #do stuff
          else:
              return render(request,'writers_block/index.html', {'comment_form':form, 'block_form':Block_form()})
  </code></pre>
  
  <p>To access it from my template form I use:</p>
  
  <pre><code>{%for block in block_list%}
  &lt;form method="post" action="{%url 'write_comment' block_id=block.id%}"&gt;
  {%csrf_token%}
  {{comment_form}}
  &lt;input type="submit" value="submit"&gt;
  &lt;/form&gt;
  {%endfor%}
  </code></pre>
  
  <p>Somehow I'm always getting a NoReverseMatch saying that write_comment with that arguments is not found:</p>
  
  <p>The urlpattern is:</p>
  
  <pre><code>url(r'^write_comment', writers_block.views.write_comment, name='write_comment')
  </code></pre>
  
  <p>Can you help me?</p>