Blog

Scribe 0.60 Release

Apr 10, 2007 — Whitney Young (Updated Apr 12, 2007)

Scribe is a new weblog that runs on Django. We just released it today, and it's available here. Since the last post about it, we've implemented a few more features and cleaned up the code quite a bit. The most significant feature is the new plugin setup that allows for spam-filters, sidebar items, and text-processors to be implemented quickly as plugins.

We hope that this application will be useful to people, and that some plugins and themes might start to pop up.

Update: Renamed release from 1.0b to 0.60.

No Comments Tags: Blog, Django, Open Source, Software

Weblog Project

Mar 18, 2007 — Whitney Young

As announced at the end of last month, we took it upon ourselves to create a weblog application. The main point was to replace Typo and reduce the large overhead the weblog was creating on the server. We wanted a fully functional weblog, but didn't need all the bells and whistles from Typo. It's pretty much finished now, and it was a lot of fun to work on.

Here are some of the features:

  • Spam filtering (with Akismet)
  • Easy caching (integrated with Django's caching mechanisms)
  • Article tagging
  • Article archives
  • Multiple user support
  • Customizable interface
  • Easy to integrate into existing (Django) sites
  • Email update for new comments
  • Uses Markdown for easy article writing

I'm considering releasing it as another open source project. Let me know if you're interested in using it or helping out with the project.

1 Comment Tags: Blog, Django, Open Source

Extending Django's Model Class

Mar 2, 2007 — Whitney Young

Django's Model class is intended to be subclassed when creating a model for your application. That's about the only intended use. But what if you want to add some extra functionality to Django's model class that all of your models can use?

You would think that something like this:

from django.db import models
class M(models.Model):
  def something_special(self): pass
class MyModel(M):
  field = models.CharField(maxlength=255)

would work just fine, but it doesn't work as desired. There's a good reason why it doesn't. Here's the MySQL code that Django produces for this setup:

BEGIN;
CREATE TABLE `myapp_mymodel` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `field` varchar(255) NOT NULL
);
CREATE TABLE `myapp_m` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY
);
COMMIT;

which helps explain why it doesn't work as desired. Django considers the M class a valid model, one that can be saved to the database, so it creates an entry in the database for it. We don't need or want it in the database, though. We just want to extend the basic model class.

Read More...

7 Comments Tags: Code, Django

Weblog and Site Changes

Feb 25, 2007 — Whitney Young (Updated Mar 18, 2007)

The blog's been offline for a long while now, so I haven't been able to give any updates on what's been changing on our server for the last few months.

Since the switch to NetworkRedux we've been able to change quite a few things on the server. For a while we were using Typo to power a weblog, and the same PHP code that the site had always used. We had to take the weblog offline because the high memory requirements of Typo (and Ruby on Rails in general) were causing high loads on our server.

In the process of looking for alternatives to Typo, I discovered the Django Web Framework. After learning Python and the Django framework, I took some of the key parts of the site and tested them out with Django. Switching the site over to Django took way less time than expected, and greatly reduced the load on our server.

We've been running the server on Django for the last two months, and everything's running great. We still have a decent amount of work to do on the weblog, namely:

  • Comments (with spam filters)
  • Labels/tags
  • Archives
  • Syndication Feed

Once we get some of these things sorted out, we may investigate the possibility of sharing the weblog as another open source project. We'll see how it turns out.

Update: The weblog has all of the listed features now. Read the Weblog Project article for more information.

No Comments Tags: Blog, Django, Webserver