enter image description here
my ad_detail.html in django-using pythonanywhere
{% extends "base_menu.html" %}
{% block title %}{{ settings.APP_NAME }}{% endblock %}
{% load humanize %} <!-- https://docs.djangoproject.com/en/3.0/ref/contrib/humanize -->
{% block content %}
<span style="float: right;">
({{ ad.updated_at|naturaltime }})
{% if ad.owner == user %}
<a href="{% url 'ads:ad_update' ad.id %}"><i class="fa fa-pencil"></i></a>
<a href="{% url 'ads:ad_delete' ad.id %}"><i class="fa fa-trash"></i></a>
{% endif %}
</span>
<h1>{{ ad.title }}</h1>
<p>
{{ ad.text }}
</p>
<p>
{{ ad.price }}
</p>
<p>
<input type="submit" value="All Ads" class="btn btn-primary " onclick="window.location.href='{% url 'ads:all' %}';return false;">
</p>
{% endblock %}
my views.py
from ads.models import Ad
from ads.owner import OwnerListView, OwnerDetailView, OwnerCreateView, OwnerUpdateView, OwnerDeleteView
class AdListView(OwnerListView):
model = Ad
class AdDetailView(OwnerDetailView):
model = Ad
fields = ["title", "text", "price"]
class AdCreateView(OwnerCreateView):
model = Ad
fields = ["title", "text", "price"]
class AdUpdateView(OwnerUpdateView):
model = Ad
fields = ["title", "text", "price"]
class AdDeleteView(OwnerDeleteView):
model = Ad
it shows “could not price in detail”…im begginer just started to learn django someone pls help me on this
New contributor
Priyan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.