Commits

Bruno Renié  committed 2896b38

Skipping PubSubHubbub subscriptions when DEBUG is True

  • Participants
  • Parent commits bc1cc9c

Comments (0)

Files changed (2)

     }
 
 .. _django-debug-toolbar: https://github.com/robhudson/django-debug-toolbar
+
+When running ``manage.py updatefeeds`` on your development machine, make sure
+you have ``DEBUG = True`` in your settings to avoid making PubSubHubbub
+subscription requests without any valid callback URL.

File feeds/utils.py

 import feedparser
 USER_AGENT = 'Aspirator/dev +http://bitbucket.org/bruno/aspirator'
 
+from django.conf import settings
 from django.db import transaction
 
 from django_push.subscriber.models import Subscription
         Initiates a PubSubHubbub subscription and
         renews the lease if necessary.
         """
+        if settings.DEBUG:
+            # Do not use PubSubHubbub on local development
+            return
+
         try:
             subscription = Subscription.objects.get(topic=topic_url)
         except Subscription.DoesNotExist: