title: Django Error NoReverseMatch at /new_bid/1 Reverse for 'addwatchlist' with arguments '('',)' not found
body: <p>I am somewhat new to Django. I'm encountering an error that I find very odd.
  The site allows a user to place a bid (enter a number amount) on an item, similar to ebay.
  When I enter the number, I get the error &quot;NoReverseMatch at /new_bid/1
  Reverse for 'addwatchlist' with arguments '('',)' not found. 1 pattern(s) tried: ['addwatchlist/(?P[0-9]+)$']</p>
  <p>This is odd because that area of the code (new_bid in views.py) has nothing to do with the addwatchlist. The addwatchlist in views.py adds this particular item to a list, for that user. It's just so a user can keep track of any items on the site they want to watch.</p>
  <p>The watchlist function works completely - I can add an item to my watchlist and it's fine.
  I don't know why this function is interacting with my other function, new_bid, which adds a bid for the item. I know this error usually is related to the url or the way the html template calls the url but I really don't know why they two are interacting. Is it because they both use &quot;id&quot;: listingid ? Any help is appreciated!</p>
  <p>urls.py for relevant urls:</p>
  <pre><code>urlpatterns = [
  
      path(&quot;addwatchlist/&lt;int:listingid&gt;&quot;, views.addwatchlist, name=&quot;addwatchlist&quot;),
      path(&quot;new_bid/&lt;int:listingid&gt;&quot;, views.new_bid, name=&quot;new_bid&quot;),
  ]
  </code></pre>
  <p>views.py for watchlist:</p>
  <pre><code>def addwatchlist(request, listingid):
      if request.user.username:
          entry = Watchlist()
          entry.user = request.user.username
          entry.listingid = listingid
          entry.save()
          return redirect('listingpage', id=listingid)
      else:
          return redirect('index')
  </code></pre>
  <p>views.py for adding your bid:</p>
  <pre><code>def new_bid(request, listingid):
      if request.method == 'POST':
          auction_to_add = Listings.objects.get(id=listingid)
          total_bid = request.POST.get(&quot;total_bid&quot;)
          bid = Bid.objects.create(user=request.user, listingid=auction_to_add, bid=total_bid)
          auction_to_add.bids.add(bid)
          auction_to_add.last_bid = bid
          auction_to_add.save()
          return render(request, &quot;auctions/listing.html&quot;, {
              &quot;id&quot;: listingid,
          })
      else:
          return render(request, &quot;auctions/listing.html&quot;, {
              &quot;id&quot;: listingid,
          })
  </code></pre>
  <p>Part of html file for placing your bid:</p>
  <pre><code> &lt;p class=&quot;lead&quot; align=&quot;justify&quot;&gt;&lt;strong&gt;Place your Bid : &lt;/strong&gt;&lt;/p&gt;
          &lt;form action=&quot;{% url 'new_bid' product.id %}&quot; method=&quot;POST&quot;&gt;
              {% csrf_token %}
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;newbid&quot; placeholder=&quot;Your 
        Bid&quot;&gt;
              &lt;/div&gt;
              &lt;p align=&quot;justify&quot;&gt;&lt;input class=&quot;btn btn-primary&quot; type=&quot;submit&quot; value=&quot;Submit&quot;&gt;&lt;/p&gt;
          &lt;/form&gt;
  </code></pre>
  <p>Part of html file for adding to watchlist:</p>
  <pre><code>&lt;a href=&quot;{% url 'addwatchlist' product.id %}&quot;&gt;&lt;button class=&quot;btn btn-primary&quot;&gt;Add to Watchlist&lt;/button&gt;&lt;/a&gt;
  </code></pre>
  <p>This is the part of views.py that will display the page itself for the specific item on the site:</p>
  <pre><code>def listingpage(request, id):
      comments = Comments.objects.filter(listingid=id)
      item = Listings.objects.get(id=id)
      return render(request, &quot;auctions/listing.html&quot;, {
          &quot;id&quot;: id,
          &quot;comments&quot;: comments,
          &quot;product&quot;: item,
      })
  </code></pre>