From 7ec4daa562b89edbd82919ee57efa8bc828c789e Mon Sep 17 00:00:00 2001 From: Horacio Ibrahim Date: Thu, 15 May 2014 22:33:13 -0300 Subject: [PATCH 1/3] Update disqus_tags.py I have used MongoDB with Django and many options is no possible as from django.contrib.sites.models import Site. I'm sure that a variable in settings can to solve. Like DISQUS_URL. For me it's very fine! This is bad? --- disqus/templatetags/disqus_tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disqus/templatetags/disqus_tags.py b/disqus/templatetags/disqus_tags.py index 45364dd..4b76c6c 100644 --- a/disqus/templatetags/disqus_tags.py +++ b/disqus/templatetags/disqus_tags.py @@ -74,8 +74,8 @@ def disqus_dev(): if settings.DEBUG: return """""" % Site.objects.get_current().domain + var disqus_url = '%s'; +""" % settings.DISQUS_URL return "" def disqus_num_replies(context, shortname=''): From 147b946e44448f9aff24fdfa1cb1e9dc896fcee3 Mon Sep 17 00:00:00 2001 From: Horacio Ibrahim Date: Thu, 15 May 2014 22:40:32 -0300 Subject: [PATCH 2/3] Database agnostic adjustmen Database agnostic adjustment removes the dependence of Site instance (from django.contrib.sites.models import Site). --- disqus/management/commands/disqus_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disqus/management/commands/disqus_export.py b/disqus/management/commands/disqus_export.py index f7f3f4a..f616d7d 100644 --- a/disqus/management/commands/disqus_export.py +++ b/disqus/management/commands/disqus_export.py @@ -51,7 +51,7 @@ def _save_state(self, state_file, last_pk): fp.close() def handle(self, **options): - current_site = Site.objects.get_current() + current_site = settings.DISQUS_URL client = DisqusClient() verbosity = int(options.get('verbosity')) dry_run = bool(options.get('dry_run')) From 67b18ac855c97b3f27a38f5f95442fb5d3e94cef Mon Sep 17 00:00:00 2001 From: Horacio Ibrahim Date: Thu, 15 May 2014 22:42:02 -0300 Subject: [PATCH 3/3] Database agnostic adjustment Database agnostic adjustment removes the dependence of Site instance (from django.contrib.sites.models import Site). --- disqus/wxr_feed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disqus/wxr_feed.py b/disqus/wxr_feed.py index 87e7661..5d0dac9 100644 --- a/disqus/wxr_feed.py +++ b/disqus/wxr_feed.py @@ -100,7 +100,7 @@ class BaseWxrFeed(Feed): feed_type = WxrFeedType def get_feed(self, obj, request): - current_site = Site.objects.get_current() + current_site = settings.DISQUS_URL link = self._Feed__get_dynamic_attr('link', obj) link = add_domain(current_site.domain, link) @@ -221,4 +221,4 @@ def comment_is_approved(self, comment): return int(comment.is_public) comment_parent = 0 - \ No newline at end of file +