def create_blog(request): user = request.user blog = Blog() blog.name = request.POST.get('name') blog.owner = user authors = [] authors.append(user) blog.save() blog.authors = authors blog.save() return HttpResponseRedirect(reverse('myblog:index'))