django-contrib-comments icon indicating copy to clipboard operation
django-contrib-comments copied to clipboard

Remove dependency on contrib.sites

Open collinanderson opened this issue 10 years ago • 6 comments

I would use this and help support it if it didn't have the not-null models.ForeignKey('sites.Site').

Similar to https://code.djangoproject.com/ticket/21381

collinanderson avatar Oct 10 '14 17:10 collinanderson

After Django 1.9 is out, the plan is to publish the last release with Django 1.6 support, then we can start leveraging the migrations framework and work on this issue.

claudep avatar Nov 11 '15 16:11 claudep

1.6.2 has been released today. We can now drop Django 1.6 and start counting on the migration system to go forward.

claudep avatar Dec 10 '15 08:12 claudep

Do you want to completely drop dependency on SITE, or make it optional?

ashwoods avatar Jul 07 '16 13:07 ashwoods

Dropping sites support means you can't use the app in a multisite system. I would just softcode it to check whether django.contrib.sites is installed and adjust the queries accordingly.

hedleyroos avatar Dec 08 '16 09:12 hedleyroos

This shouldn't be too hard to do. For example, calls to sites.shortcuts.get_current_site(request) work regardless of 'sites' being installed. The '0001' migration needs to be changed to not be dependent on 'sites', use of settings.SITE_ID needs changing, and the change to the aforementioned ForeignKey.

Are the devs open to a PR related to this?

tisdall avatar Mar 29 '17 19:03 tisdall

If you think your proposal will be able to cope with backwards compatibility, then sure!

claudep avatar Mar 29 '17 20:03 claudep