Archive for October 2009

A BeautifulSoup with Django and Pygments

Saturday, October 24, 2009

Just added syntax highlighting using BeautifulSoup and Pygments. I took the SaltyCrane Blog for inspiration, but in contrast to it, I implemented it as a template filter in a separate application. This is surely not the most performant way, but I’m planning to use memcache, so I think this is ok.

Here an example how to use the filter:

{% load highlight_code %}
{{ my_var_with_code|highlight|safe }}

More Feeds

Tuesday, October 20, 2009

Just added Atom Feeds for post categories and post comments. They are available in the category detail and post detail views.

Comments and an Atom Feed

Sunday, October 18, 2009

Small update for this site: Comments are now working and there is an Atom Feed for the latest posts in this blog.

The behaviour and the style of the comments is not very polished yet, but I’ll work on that later. I’ll also add more feeds, e.g. for post comments, categories and tags.

Magic! Python! Django! Whee!

Wednesday, October 14, 2009

This blog is now run by Django. I didn’t really like Wordpress which I used before. And also I don’t like PHP anymore (I really liked it some years ago, but everything changed, when I learned Python …).

When I told a friend that I wanted to switch from Wordpress to something else, he just said: «Use Django.» So I took a look at the Tutorial and was instantly thrilled.

At first, I wanted to use an existing weblog app, but I also wanted to code an app for my own and since I din’t find a weblog app that I 100% liked, I just decided to write my own. So here it is (far from finished though)!

Features so far:

  • Basic post model (title, slug, pub date, modify date, status, category, HTML body)
  • Post manager for post counts (per year, month, category (and tag))
  • Hierarchical category model – imho, this is the highlight of my app.
  • Archive and Categories
  • Some special template tags.
  • Usage of a recursive template tag for the categories
  • Unit- and doctests for the models and template tags

Features to come:

  • Comments
  • Atom feeds
  • Sidebar
  • Static pages
  • Trac integration for my projects
  • Search
  • Last.fm sidebar widget
  • Tags for posts (via django-tagging?)
  • CKEditor integration
  • Pygments integration
  • Improved image/media support for posts
  • Admin actions for posts (e.g. change status and category)
  • Preview function for new posts

That’s it so far. When I have Trac running, I’ll also publish the source of my applications. :-)

Django pony