def post(self, request): title = request.POST.get('title') content = request.POST.get('content') blog = Blog(title=title, content=content) blog.save() return HttpResponse('add blog success!!!')
def post(self, request): title = request.POST.get('title') content = request.POST.get('content') blog = Blog( title=title, content=content ) blog.save() return HttpResponse('add blog success!!!')
def post(self, request): if request.user.is_authenticated(): title = request.POST.get('title') content = request.POST.get('content') blog = Blog( title=title, content=content ) blog.save() return HttpResponse('add blog success!!!') return HttpResponse('auth fail!')