Monday, September 11, 2017

Re: The view blog.views.create didn't return an HttpResponse object. It returned None instead.can any one help me this issue please nooob here

if request.method == "GET":
if request.method == "POST":

Uppercase is needed.

2017-09-11 17:36 GMT-06:00 harsh sharma <harshsharma199622@gmail.com>:
 here i m learning django and i m stuck on one thing 
the web page returning 
The view blog.views.create didn't return an HttpResponse object. It returned None instead.


and here is my views.py  file


def home(request):

story = Story.objects.all()
return render_to_response('show.html',{'story':story})



def create(request):
if request.method == "get":
form = storyform()
return render(request,'form.html',{'form':form})
elif request.method == "post":
form= storyform(request.POST)
form.save()
return HttpResponseRedirect('/home')

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/067af0b0-6761-4daf-a1c0-02fcd1585048%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/CAG%2B5VyMqn-Z%3Das%3DYxf_oph5yvDfUi%2BZWU1Uf_554fOTC2y3rsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment