title: Django NoReverseMatch 5
body: <p>I'm getting this error, and I don't know why:</p>
  
  <pre><code>  Reverse for 'buildings.views.generate' with arguments '()' and keyword arguments '{'new_id': -1}' not found.
  </code></pre>
  
  <p>Here is ( a part of ) my urls.py:</p>
  
  <pre><code>  url(r'^buildings/generate/new_building(?P&lt;new_id&gt;\d+)', 'buildings.views.generate'),
  </code></pre>
  
  <p>The view:</p>
  
  <pre><code>  @login_required
    def generate(request, new_id):
            session = {}
  
            if new_id == -1:
                    other_buildings = Building.objects.filter(utente=request.user, pronto=False)
  
                    if other_buildings.length &gt; MAX_TEMPORARY_BUILDINGS:
                            return redirect('buildings.views.index')
                    else:
                            building = Building(utente=request.user, pronto=False)
                            building.save()
                            return redirect('buildings.views.generate', building_id=building)
  
            elif new_id &gt;=0:
  
                    building = Building.objects.filter(pk=new_id)
  
                    if building.utente != request.user:
                            raise Http404
                    elif building.pronto:
                            return redirect('buildings.views.detail', building_id=new_id)
                    elif building.nome == None:
                            buildings= Building.objects.filter(pronto=True).order_by('utente')
                            session['buildings'] = buildings
  
                    session['building'] = building                        
            else:
                    raise Http404
  
            return render_to_response('buildings/generate/generate-index.html', session, context_instance = RequestContext(request))
  </code></pre>
  
  <p>And here it is the code in the template "base.html" that generates the error:</p>
  
  <pre><code>  &lt;li&gt;&lt;a href="{% url buildings.views.generate new_id=-1 %}"&gt;New Building&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I can't see any errors, help me please.</p>