【发布时间】:2014-07-30 18:25:43
【问题描述】:
我是 Django 的初学者。你们能告诉我为什么我会收到这个错误。 代码:
enter code here:
import feedparser
from django.http import HttpResponse
def news():
YahooContent = feedparser.parse ("http://news.yahoo.com/rss/")
for feed in YahooContent.entries:
print feed.published
print feed.title
print feed.link + "\n"
return
def html():
html = "<html><body> %s </body></html>" % news()
return HttpResponse(html)
错误:
TypeError at /news/
html() takes no arguments (1 given)
Request Method: GET
Request URL: this is not a url : (http://djangodefault.com:8000/news/)
Django Version: 1.6.5
Exception Type: TypeError
Exception Value:
html() takes no arguments (1 given)
【问题讨论】:
标签: python django python-2.7 django-forms