On Dec 8, 2015 5:08 AM, "Yogs" <yogitha1...@gmail.com> wrote:
>
> Can somebody hlep me out with this?
> This the error I get when i run the polls app
>
>
> NameError at /polls/
>
> global name 'HttpResponse' is not defined
>
> Request Method:
> GET
> Request URL:
> http://127.0.0.1:8000/polls/
> Django Version:
> 1.9
> Exception Type:
> NameError
> Exception Value:
>
> global name 'HttpResponse' is not defined
>
> Exception Location:
> /home/yogitha/Desktop/mysite/polls/views.py in index, line 6
> Python Executable:
> /usr/bin/python
> Python Version:
> 2.7.6
> Python Path:
>
> ['/home/yogitha/Desktop/mysite',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PILcompat',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
>
> Server time:
> Mon, 7 Dec 2015 16:35:58 +0000
>
>
> Please tell me what needs to be done
>

It appears you are missing an import statement for HTTPResponse at the top
of your views.py. Admittedly, the tutorial does omit those statements in
most places since they assume you have already added the necessary imports
from the first couple of steps.

See the first line of code in the first code block here:

https://docs.djangoproject.com/en/1.9/intro/tutorial01/#write-your-first-view

-James

-- 
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/CA%2Be%2BciXpvheGVGVr60DGmjWZXuXZYpW4OE-qQwsEPoem0uwZkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to