【发布时间】:2014-10-29 15:17:16
【问题描述】:
我试图在 Django 网页上显示我的视图函数的结果,但只有一行没有超链接。
代码:
from django.http import HttpResponse
import feedparser
def index(content):
YahooContent = feedparser.parse ("http://news.yahoo.com/rss/")
for feed in YahooContent.entries:
content = (feed.title + ": " + "\n"+feed.link + "\n" + feed.published + "\n")
return HttpResponse(content)
网页上的结果:
因失踪的亚利桑那女孩死亡而被捕的男子:http://news.yahoo.com/arizona-girls-home-searched-body-found-154919366.html Thu, 04 Sep 2014 14:05:16 -0400
【问题讨论】:
标签: python django python-2.7 django-views