[Solved] django AttributeError: ‘UserComment‘ object has no attribute ‘save‘

Change to modelform, and the code in views is as follows:

form.instance.comment_man = request.user
form.instance.comment_course_id = couseid
form.instance.comment_comment = textcontent
form.instance.add_time = timezone.now()
form.save()

Read More: