I have a Django template that contains a message with a variable, but the words that are not in the variable appear all the time. I think it has something to do with the conditional if closeListing == True. I explicitly state when I want it to be True, so I don't know what's happening.
views.py
@login_required(login_url='login')
def listing(request, id):
    #gets listing
    listing = get_object_or_404(Listings.objects, pk=id)
    sellar = listing.user
    #close listing code
    if sellar == request.user:
        closeListingButton = True
    else: 
        closeListingButton = False
    closeListing = ''
    try:
        has_closed = get_list_or_404(CloseListing, Q(user=request.user) & Q(listings=listing))
    except:
        has_closed = False
    if has_closed:
        closeListing = False
    else: 
        closeListing = True
   if request.method == "POST":
        #close listing code
        if request.POST.get('close'):
            CloseListing.objects.create(user=request.user, listings=listing)
            closeListing = True
            closeListingButton = False
            add_or_remove_watchlist = True
            winning_bid = Bids.objects.aggregate(Max('bid'))
            winning_bid = Bids.objects.latest('bid')
            winner = winning_bid.user
            return render(request, "auctions/listing.html",{
                        "auction_listing": listing,
                        "comments": comment_obj,
                        "bids": bid_obj,
                        "closeListingButton": closeListingButton,
                        "closeListing": closeListing,
                        "closedMessage": "This listing is closed.",
                        "winner": winner
            })
   return render(request, "auctions/listing.html",{
                 "auction_listing": listing,
                 "closeListingButton": closeListingButton, 
                 "closeListing": closeListing
  })
listing.html
{% if closeListing == True %}
     <div>
          {{ closedMessage }}
          <br>
          {{ winner }} has won the auction!
     </div>
{% endif %}
 
    