honzakral / django-threadedcomments

django-threadedcomments is a simple yet flexible threaded commenting system for Django.
BSD 3-Clause "New" or "Revised" License
622 stars 165 forks source link

RemovedInDjango19Warning (2) #73

Closed vmarkovtsev closed 8 years ago

vmarkovtsev commented 8 years ago

I think this is different from #71

When I try to use ThreadedComment model in my app, I get a single

threadedcomments/models.py:9: RemovedInDjango19Warning: Model class threadedcomments.models.ThreadedComment doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class ThreadedComment(Comment)

After reading for example this question on StackOverflow and examining how similar projects were fixed (https://github.com/DanielJDufour/python-social-auth/commit/b51629fcc54ad755f1b17f27712aacc860f34129), I suggest to remove imports from init. ThreadedComments model is imported during package import, before Django app is initialized, thus the warning is printed.

vdboor commented 8 years ago

Thanks! the pull request is merged! If you see any other Django 1.9 issues, don't hesitate to make another PR!