Re: Stuck with Django Tutorial Part 4

2023-03-15 Thread Chetan Ganji
It seems to me like you are not entering the url name In place of 'polls:vote' try to enter the name of the url given to that url For Your Reference https://docs.djangoproject.com/en/4.1/ref/templates/builtins/#url I hope it helps you! Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com h

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Here. urls.py from django.urls import path from . import views app_name = 'polls' urlpatterns = [ path('', views.IndexView.as_view(), name='index'), path('/', views.DetailView.as_view(), name='detail'), path('/results/', views.ResultsView.as_view(), name='results'), path('/vote

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
This should be your views for vote. from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .models import Choice, Question # ... def vote(request, question_id): question = get_object_or_404(Questi

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Brian Carey
I think you need to check your urls.py. ⁣Get BlueMail for Android ​ On Mar 14, 2023, 1:33 PM, at 1:33 PM, Nithin Kumar wrote: >question.id or question_id both gave the same result. >These are the views. > >from django.shortcuts import get_object_or_404, render >from django.http import HttpResp

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Sandip Bhattacharya
Can you share your urls.py? > On Mar 14, 2023, at 1:33 AM, Nithin Kumar wrote: > > Hi, > > Stuck with this problem > > https://docs.djangoproject.com/en/4.1/intro/tutorial04/ > > NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not > found. 1 pattern(s) tried: ['polls/

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
question.id or question_id both gave the same result. These are the views. from django.shortcuts import get_object_or_404, render from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import loader from .models import Choice,Question from django.urls import reve

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
Let's see your views. On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman wrote: > question_id=question.id > > On Tue, 14 Mar 2023 at 21:22, Nithin Kumar > wrote: > >> Hi, >> >> Stuck with this problem >> >> https://docs.djangoproject.com/en/4.1/intro/tutorial04/ >> >> NoReverseMatch at /

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Muhammad Juwaini Abdul Rahman
question_id=question.id On Tue, 14 Mar 2023 at 21:22, Nithin Kumar wrote: > Hi, > > Stuck with this problem > > https://docs.djangoproject.com/en/4.1/intro/tutorial04/ > > NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not > found. 1 pattern(s) tried: ['polls/ > My detail.ht

Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Hi, Stuck with this problem https://docs.djangoproject.com/en/4.1/intro/tutorial04/ NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not found. 1 pattern(s) tried: ['polls/ {% csrf_token %} {{ question.question_text }} {% if error_message %}{{ error_