The view todo.views.homepage didn't return an HttpResponse object. It returned None instead.

139 views
Skip to first unread message

Shubham Chauhan

unread,
Jul 1, 2019, 12:52:12 PM7/1/19
to Django users
hi folks, i'm beginner in django and i try to make a to-do list app and this error comes please help me out
Screenshot (49).png
Screenshot (50).png

Kasper Laudrup

unread,
Jul 1, 2019, 1:28:01 PM7/1/19
to django...@googlegroups.com
Hi Shubham,

On 01/07/2019 18.52, Shubham Chauhan wrote:
> hi folks, i'm beginner in django and i try to make a to-do list app and
> this error comes please help me out
>

In Python, if a function doesn't return anything, it will implicitly
return "None".

If you look at your "homepage" function, you actually have three places
the function can return, but only two explicit returns (which return an
HttpResponse as the error message informs you is required).

Knowing that, try to consider what will happen if the form is *not*
valid, ie. the call to "form.is_valid()" returns false.

Hope that can point you in the right direction.

I could just give you answer, but if you want to learn, I think it's
better you try to figure it out yourself.

Kind regards,

Kasper Laudrup

Shubham Chauhan

unread,
Jul 1, 2019, 1:31:01 PM7/1/19
to django...@googlegroups.com
Thank you so much 

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1eabf835-5986-3f91-886d-f7b01f7cce08%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages