Example #1
0
    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!!!')
Example #2
0
    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!!!')
Example #3
0
    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!')