You are having an error on your template. {%url 'polls:detail' question.id%}
instead of {% url 'polls:detail' question.id %}
Take note of the space after or before the percentage sign. Django
Templating Engine requires you to respect the rules. If you even add double
spaces where you are supposed
I have made some typo errors in typing: *view_count, *please just adjust
that in the code. So it should be "*view_count*" anywhere i mistakenly
wrote "*views_count*"
On Wednesday, December 18, 2019 at 4:25:33 PM UTC+1, JEAN MARLON MBAN wrote:
>
> how to display the number of views of an article
First, add a column on the article Model named "views_count"
Then on the DetailView of the article, and on the GET method. add this:
article.view_count += 1
article.save()
# or (asuuming you are using class based views)
self.object.view_count += 1
self.object.save()
The problem
I am a Django Developer, can work with you depending on the conditions of
work. Checkout some of my works here: https://njanginetwork.com,
https://billstack.net.
On Wednesday, December 18, 2019 at 2:08:57 PM UTC+1, Moise Sacko wrote:
>
> Hi. I want to create an hotel management project in
4 matches
Mail list logo