Can not sync my django database after installing django.contrib.comments app

473 views Asked by At

Error that I have:

CommandError: One or more models did not validate:
comments.comment: Accessor for field 'content_type' clashes with related field 'ContentType.content_type_set_for_comment'. Add a related_name argument to the definition for 'content_type'.
comments.comment: Reverse query name for field 'content_type' clashes with related field 'ContentType.content_type_set_for_comment'. Add a related_name argument to the definition for 'content_type'.
comments.comment: Accessor for field 'site' clashes with related field 'Site.comment_set'. Add a related_name argument to the definition for 'site'.
comments.comment: Accessor for field 'user' clashes with related field 'User.comment_comments'. Add a related_name argument to the definition for 'user'.
comments.comment: Reverse query name for field 'user' clashes with related field 'User.comment_comments'. Add a related_name argument to the definition for 'user'.
comments.commentflag: Accessor for field 'user' clashes with related field 'User.comment_flags'. Add a related_name argument to the definition for 'user'.
comments.commentflag: Reverse query name for field 'user' clashes with related field 'User.comment_flags'. Add a related_name argument to the definition for 'user'.

In the beginning I installed newer app called django_comments, and did sync my database. But after I decided to use django-fluent-comments that need django.contrib.comments. So insteed of django_comments I put django.contrib.comments.

After I sync database my django project crashed with the error above.

So, please help to solve this problem or give me some recommendations.

Thanks for any advices!

PS: I tried to create new project with another virtualenvironment and changed mysql to sqlite3, but still have this error.

1

There are 1 answers

1
Shyngys Kassymov On BEST ANSWER

I solved my problem. It was because I forgot to delete all imports in my models from old app django_comments. So now everything works fine!