Django RSS 提要
我正在尝试开发一个简单的网站:
1- 自动从我的数据库中获取 5 个最新条目。条目是我手动输入的新闻标题。
2- 在简单的网页上显示这些条目(没有花哨的格式或其他任何内容)
3- 网站定期搜索新发布的条目并显示它们,而无需用户刷新网页。
我正在使用 Django,边学习如何实现不同的功能。
问题(为了能够实现第 3 点):
1- RSS feed 是我应该寻找的吗? Django 有联合提要框架,我想知道是否应该使用它。
2-如果 RSS 不是可行的方法,有人可以指出我正确的路径/可能的教程来帮助我吗?我被困在这个问题上,并且是网络编程的新手。
提前感谢您的帮助!
I am trying to develop a simple site that:
1- Automatically fetch from my db the 5 latest entries. Entries are news headline titles that I input manually.
2- display these entries on a simple webpage (no fancy formatting or anything else)
3- The site periodically searched for newly posted entries and displays them without having the user refreshing the webpage.
I am using Django, learning how to implement different functions as I go.
Question (to be able to implement point 3):
1- Is RSS feed what I should be looking for? Django has the syndication feed framework and I am wondering if I should use it or not.
2- If RSS is not the way to go, can someone point me to right path / possible tutorial that might help me out? I am stuck on this and new to web programming.
Thx in Advance for any help!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“无需用户刷新网页”即可更改内容的唯一方法是使用 Javascript。因此,您需要编写一些 JS 来向 Django 服务器发出 AJAX 请求,提取最新的博客条目,并将它们显示在页面上,然后设置 x 分钟内下次执行的超时。
我不确定您为什么希望将其显示在网页上。如果您需要 RSS 阅读器,请使用已有的众多阅读器之一。
The only way to have content change "without having the user refreshing the webpage" is to use Javascript. So you'll need to write some JS that fires off an AJAX request to the Django server, pulls in the latest blog entries, and displays them on the page, then sets a timeout for the next execution in x minutes.
I'm not sure why you want this to be on a web page though. If you want an RSS reader, use one of the many that are out there already.
这看起来像是您需要的普通博客框架。这种设置有很多例子。
http://www.lightbird.net/dbe/blog.html
http://www.webmonkey.com/2010/02/Install_Django_and_Build_Your_First_App/
This looks like a normal blogging framework that you need. There are a lot of examples for such a setup.
http://www.lightbird.net/dbe/blog.html
http://www.webmonkey.com/2010/02/Install_Django_and_Build_Your_First_App/