3

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.

2
  • What version of Django do you use ? Did you custom your site or user model ? According to the error, it has nothing to do with your database, but only with Django models not validating (everytime you run a runserver/syncdb, ... command it validates the models)
    – Ricola3D
    Aug 8, 2013 at 7:45
  • Sorry, but I found my mistake)) As you say it was in my models.py. There was some import from old app django_comments, so after I deleted this line everything start to work. Thanks for help. Aug 8, 2013 at 8:04

1 Answer 1

1

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!

1
  • Strange error messages for such an error. Well I guess this could be usefull to other Django users later, even if django.contrib.comments is now deprecated :)
    – Ricola3D
    Aug 8, 2013 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.