Django reverse is giving me some trouble
<p>My problem is that when reverse is called it throws the following exception</p>

<p>Reverse for '/documentation/' with arguments '(3,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []</p>

<p>Here is my urls.py</p>

<pre><code>url(r'^documentation/$', views.view1),
url(r'^documentation/([0-9])/$', views.documents, name='documentation'),
</code></pre>

<p>here my views.py</p>

<pre><code>def view1(request):

  if request.method == 'POST':
      profe = request.POST.get('value')

      a = value.encode('ascii', 'ignore')
      b = int(a)
      return HttpResponseRedirect(reverse('documentation', args=(b,)))

else:

    return render(request, "documentation.html", info)

def documents(request,valor):
      ...something...
      return render(request, "anotherdoc.html", ..something..)
</code></pre>

<p>and here is my template (documentation.html)</p>

<pre><code>...
&lt;form method="POST" action=""&gt;
    {% csrf_token %}
    {% for p in ps %}
    &lt;tr&gt;
        &lt;td&gt;&lt;button id="boton1" button type="submit" name = "valor" value ="{{p.idp}}" class="btn btn-success btn-sm"&gt;{{p.nombre}} {{p.apellido}}&lt;/button&gt;
        &lt;/td&gt;
        &lt;td&gt;algo&lt;/a&gt; &lt;/td&gt;
    &lt;/tr&gt;
    {%endfor%}
&lt;/form&gt;
</code></pre>

<p>I want 127.0.0.1:8000/documentation/1 from reverse() but IÂ´m having a hard time trying that</p>

<p>Thanks</p>

<p>(Edit with traceback)</p>

<pre><code>Traceback:

File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\Pa\De\Nueva carpeta\ag\Ag\scheduler\views.py" in documentation
  82.         url = reverse('documentation', args=(3,))

File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in reverse
  600.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))

File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in _reverse_with_prefix
  508.                              (lookup_view_s, args, kwargs, len(patterns), patterns))

Exception Type: NoReverseMatch at /documentation/
Exception Value: Reverse for 'documentation' with arguments '(3,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []
</code></pre>

<p>Reverse uses the URL name and you declared the name as <code>name='documentation'</code> but we can see you are using <code>'/documentation/'</code> instead:</p>

<pre><code>File "C:\Users\Pa\Desktop\Nueva carpeta\ag\Ag\scheduler\views.py" in documentation
  82.         url = reverse('/documentation/', args=(3,))
</code></pre>

<p>Change that line to <code>url = reverse('documentation', args=(3,))</code></p>

<p>If your URLs are name-spaced (you would know this if you have another urls.py in which this urls is include()), you should use <code>'[namespace]:documentation'</code>.</p>

python django