Python 如何在Django PuSH中创建回调URL
我正在使用(pubsubpub)作为我的博客 现在,我阅读了文档,可以编写简单的代码。但是,该文档从未提到在任何地方输入回调URL 下面是简单的代码Python 如何在Django PuSH中创建回调URL,python,django,django-views,django-signals,websub,Python,Django,Django Views,Django Signals,Websub,我正在使用(pubsubpub)作为我的博客 现在,我阅读了文档,可以编写简单的代码。但是,该文档从未提到在任何地方输入回调URL 下面是简单的代码 # hubserver.py @receiver(updated) def listener(notification, **kwargs): e = [] for entry in notification.entries: e.append(entry.title) for link in e:
# hubserver.py
@receiver(updated)
def listener(notification, **kwargs):
e = []
for entry in notification.entries:
e.append(entry.title)
for link in e:
db = entries( url = link )
db.save(force_insert=True)
from django.shortcuts import render_to_response
from django_push.subscriber.models import Subscription
from models import mydata
# views
def bloghub (request):
subscription = Subscription.objects.subscribe("http://myblog.blogspot.in//feeds/posts/default",
"http://pubsubhubbub.appspot.com")
db = mydata.objects.all()
lis = [i.url for i in db]
context = {"lis" : lis}
return render_to_response("home.html", context)
[1]: http://django-push.readthedocs.org
# urls.py
urlpatterns = patterns('',
url(r'^$', views.bloghub ),
url(r'^subscriber/', include('django_push.subscriber.urls')),
)