Can you share your views.py, result.html and urls.py?

On Thursday, 24 April 2014 12:10:33 UTC+1, Srinivasulu Reddy wrote:
>
>
>
> On Wednesday, April 23, 2014 2:57:45 PM UTC+5:30, Srinivasulu Reddy wrote:
>>
>> Hi Folksl , 
>>
>>
>>       In dealing with poll app tutorial 4 i am getting an error, posting 
>> it down. Help me to find a way to solve the problem in dealing with 
>> results.html and results view . It's throwing IndexError.
>>
>>    Before changing results view it's working good. After changing result 
>> view and after creating in results.html . I am getting this problem after 
>> clicking "Vote" button on my browser.  Is anyone there to help me
>>
>>
>>   python manage.py runserver
>>
>> Validating models...
>>
>> 0 errors found
>> April 23, 2014 - 09:20:10
>> Django version 1.6.2, using settings 'dj_tutorial.settings'
>> Starting development server at http://127.0.0.1:8000/
>> Quit the server with CONTROL-C.
>> [23/Apr/2014 09:20:15] "GET /poll/ HTTP/1.1" 200 408
>> [23/Apr/2014 09:20:18] "GET /poll/specifics/7/ HTTP/1.1" 200 599
>> [23/Apr/2014 09:20:23] "POST /poll/7/votes/ HTTP/1.1" 302 0
>> Internal Server Error: /poll/7/results/
>> Traceback (most recent call last):
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/core/handlers/base.py",
>>  
>> line 114, in get_response
>>     response = wrapped_callback(request, *callback_args, 
>> **callback_kwargs)
>>   File 
>> "/home/seenu/work/Django_proj/d_tutorial/dj_tutorial/poll/views.py", line 
>> 24, in results
>>     poll = get_object_or_404(Poll, poll_id)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/shortcuts/__init__.py",
>>  
>> line 113, in get_object_or_404
>>     return queryset.get(*args, **kwargs)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 298, in get
>>     clone = self.filter(*args, **kwargs)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 590, in filter
>>     return self._filter_or_exclude(False, *args, **kwargs)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/query.py",
>>  
>> line 608, in _filter_or_exclude
>>     clone.query.add_q(Q(*args, **kwargs))
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>>  
>> line 1192, in add_q
>>     if not self.need_having(q_object):
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>>  
>> line 1155, in need_having
>>     return any(self.need_having(c) for c in obj.children)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>>  
>> line 1155, in <genexpr>
>>     return any(self.need_having(c) for c in obj.children)
>>   File 
>> "/root/.virtualenvs/djan/local/lib/python2.7/site-packages/django/db/models/sql/query.py",
>>  
>> line 1153, in need_having
>>     or (hasattr(obj[1], 'contains_aggregate')
>>
>  
>
>> IndexError: string index out of range
>> [23/Apr/2014 09:20:24] "GET /poll/7/results/ HTTP/1.1" 500 91775
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Wednesday, April 23, 2014 12:58:54 PM UTC+5:30, Daniel Roseman wrote:
>>>
>>> Why have you posted screenshots of text to a text-based newsgroup? 
>>> Please copy and paste the relevant text into a message (the Django error 
>>> page even has a special link to go to a copy and paste view).
>>> -- 
>>> DR.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a2232e5-430e-41d7-8b35-974bd6c34fab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to