Django-liveblog is a project mainly written in Python, based on the BSD-3-Clause license.
A live-blogging application meant to work alongside an existing blogging application.
This is a live-blogging application meant to work alongside an existing blogging application.
The main blogging application must have a model for entries that the live-blogging model can use as a foreign key.
Django (Tested with 1.1 but should work with 1.0)
Markdown for Python (http://www.freewisdom.org/projects/python-markdown/)
A Django blogging application
The appearance of the live-blogging entries can be customized in the template of the main blog entry (or in a separate template file, using {% include %}). See Usage below.
The live-blogging entries can be ordered newest-to-oldest or oldest-to-newest.
For example, if your main blogging application is called 'blog', and it uses a model called 'Entry' to represent a blog entry, you would add the following to settings.py: BLOG_APP = 'blog' BLOG_ENTRY_MODEL = 'Entry'
This allows the live-blogging application to do the equivalent of 'from blog.models import Entry', which allows it to use Entry as a foreign key.
Run manage.py syncdb to create the necessary table for the live-blogging application.
In the template that's used to display a main blog entry, add the following:
{% load order_queryset %}
Customize the following template code to your liking and add it to the template. 'object' is a main blog entry.
{# If this entry has associated live-blog entries (i.e., it is a live blog), show them. #}
{% if object.liveblogentry_set.all %}
<p>Order:
{% ifequal liveblog_order 'pub_date' %}
<a href="{{ object.get_absolute_url }}?order=asc">newest first</a>
{% else %}
newest first
{% endifequal %}
|
{% ifequal liveblog_order '-pub_date' %}
<a href="{{ object.get_absolute_url }}?order=desc">oldest first</a>
{% else %}
oldest first
{% endifequal %}
</p>
<ul class="liveblog">
{% for entry in object.liveblogentry_set.all|order_by:liveblog_order %}
<li>
<p><strong>{{ entry.pub_date|date:"P" }}:</strong>
{{ entry.body }}</p>
</li>
{% endfor %}
</ul>
{% endif %}
In your admin site, you'll see 'Live Blog Entries' listed. Add, edit or remove a live-blog entry just as you would any other item in the Django admin. Each live-blog entry must be associated with a main-blog entry (the main blog entry is where you would put an introduction, etc.). By default, the associated main-blog entry is the newest entry, but any blog entry can be selected in the admin.
http://bycoffe.com/blog/2009/jul/15/statknowledge-day-one/
This application includes an order_by template filter found here: http://www.djangosnippets.org/snippets/741/