Search code examples
pythondjangodjango-comments

how to make django comment model field Site not required


I'm using django-threadedcomments from ericflo on github. This app simply extends the native django comments framework. I am running into the same issue with both frameworks. I continue to get an error relating to mysql that site_id cannot be null. I have no use for the Site field in my comments. I tried to extend the Comment model with my own making site both blank and null but I am still getting the same error. What is the proper way to override that requirement? Thanks

I tried:

class Comment(Comment):
    site=models.ForeignKey(Site,null=True,blank=True)

Solution

  • I found it easier to just define one Site object. django-threadedcomments is not the only extension which requires that.