[Fixed]-Object has no attribute get while overriding the POST method

1👍

✅

Your post method is returning an instance of your model

return new_post

All views must return a HttpResponse so the simplest thing to return with your new post in the context would be render

return render(request, self.template_name, {'new_post': new_post })

Leave a comment