Новая ставка не обновляется для отображения ввода пользователя (сумма) Django

Пытаюсь создать платформу, подобную e-bay, где пользователи могут выбрать товар и сделать на него ставку, сумма ставки должна обновляться до последней действительной ставки, введенной пользователем.

В настоящее время сумма не обновляется, чтобы показать, что пользователь сделал ставку, она показывает мне всплывающее сообщение

                messages.success(request, 'Successfully added your bid')

но не обновляет эту часть, показывая ставки или увеличивая их количество

 <p>Current price: ${{ detail.current_bid }}</p>

Не могли бы вы подсказать мне, что является причиной этого?

MODELS.PY


class Auction(models.Model):
    title = models.CharField(max_length=25)
    description = models.TextField()
    current_bid = models.IntegerField(null=False, blank=False)
    image_url = models.URLField(verbose_name="URL", max_length=255, unique=True, null=True, blank=True)
    created_at = models.DateTimeField(auto_now_add=True)
    category = models.ForeignKey(Category, max_length=12, null=True, blank=True, on_delete=models.CASCADE)
    is_active = models.BooleanField(default=True)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

    def __str__(self):
        return f"(self.title)"

    def no_of_bids(self):
        return self.bidding.all().count()
    
    def current_price(self):
        if self.no_of_bids() > 0:
            return self.bidding.aggregate(Max('new_bid'))['new_bid__max']
        else: 
            return self.current_bid

    def current_winner(self):
        if self.no_of_bids() > 0: 
            return self.bidding.get(new_bid=self.current_price()).user
        else: 
            return None

    class Meta:
        ordering = ['-created_at']

class Bids(models.Model):
    auction = models.ForeignKey(Auction, on_delete=models.CASCADE, related_name='bidding', null=True)
    user = models.ForeignKey(User, on_delete=models.PROTECT, related_name='bidding')
    new_bid = models.DecimalField(max_digits=8, decimal_places=2)
    done_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return str(self.new_bid)

    class Meta:
        ordering = ['auction', '-new_bid']

VIEWS.PY

@login_required
def make_bid(request, listing_id):
    if request.method == 'POST':
        auction = Auction.objects.get(pk=listing_id)
        bid_form = BidForm(request.POST)
        if bid_form.is_valid():
            bid_form.instance.user = request.user
            bid_form.instance.item = auction

            if bid_form.instance.new_bid > auction.current_price():
                bid_form.save()
                messages.success(request, 'Successfully added your bid')
                return HttpResponseRedirect(reverse("listing_detail", args=(listing_id,)))
            else:
                messages.error(request, 'Bid price lower than current price, increase bid please')
                return HttpResponseRedirect(reverse("listing_detail", args=(listing_id,)))


        else:
            context = {
                'bid_form': bid_form
                }
            
            return render(request, 'auctions/details.html', context)  
                
    return render(request, 'auctions/details.html', {'bid_form': bid_form})  

FORMS.PY

class BidForm(forms.ModelForm):

    class Meta:
        model = Bids
        fields = ['new_bid']
        labels = {
            'new_bid': ('Bid'),
        }

DETAILS.PY

                            <p>Current price: ${{ detail.current_bid }}</p>
                            <hr>
                            <p>{{ detail.no_of_bids }} bids so far</p>
                            <hr>

                            <form action="{% url 'make_bid' detail.id %}" method="post">
                                {% csrf_token %}
                                {{ bid_form }}
                                <input type="submit" class="btn btn-primary btn-block mt-3" value="Place bid">
                            </form>

URL.PY

    path("make_bid/<int:listing_id>", views.make_bid, name="make_bid"),
Вернуться на верх