Notice Something Different?

Several months ago after rolling out the lifestreaming features on this site, I became unhappy with the way that the design scaled with the new feature. Around that time I did a purely-visual refactor (just templates and CSS changed--no code), but it has sat untouched on my hard drive for several months.

Today I ran across that redesign and since it essentially looked complete, I deployed it to the site. I'm still not very happy with the design, but I think that this time it's at least easier to read than the last one, which had become very cluttered and difficult to navigate and read.

Let me know what you think in the comments.

Blog Updated (now with more CouchDB)

I posted a while back about using CouchDB with Django, talking about how one might build a lifestreaming application combining the flexibility and power of CouchDB with the ease of use and utility of Django. I even linked to the project on github. At the time I was taking a hard look at the Django-based software that was running this blog. It needed some work, to say the least. So I did a bit of cleanup, a LOT of reorganization, and integrated this CouchDB-based lifestreaming application into the mix.

There's no visual refresh--that will come some other time. For right now, it's just a backend refresh, so for the most part nobody will notice anything. But I can rest much easier knowing that the backend is just a little bit less of a mess. It's also a LOT easier to deploy. I've integrated a Fabric deployment script so that all I need to do is type:

fab deploy

And everything gets zipped up, sent to the server, unziped, and all of the relevant processes get restarted. Pretty cool! That's going to allow for much more rapid iteration on the site, so changes can come more often and bugs can be fixed.

Because of that, expect more experimentation. As I'm experimenting with Django stuff, I'll do a lot more public demos where the experimentations are public for the world to see and play around with. I've got lots of ideas for Django-y experiments and it's going to be really fun to see how they shape up.

So what do you think? Is the new lifestreaming stuff annoying or cool?

XFN Markup Enabled

The recently released Google Social Graph API was a bit of a wake-up call for me on the power and importance of microformats. So I've hacked together a quick implementation of XFN for the blogroll, and added a few rel=me links as well.

I'll follow this sometime soon with a post about how I implemented the XFN on a Django model.

Fun Way of Displaying a Blogroll

I've just relaunched the redesign of this site. Nothing major is different, but one fun thing that I'd like to highlight is the way the blogroll is displayed. I got the idea from Motel de Moka, which has more links to work with than I do.

First, I set up a very simple model:

class BlogRollLink(models.Model):
    name = models.CharField(max_length=128)
    date_added = models.DateTimeField(default=datetime.now)
    url = models.URLField()

But we've got a problem at this point: we can't order this by the number of characters in the name. So we must modify our model to have an integer called name_size, and then override BlogRollLink's save function to fill in that field any time the model is saved. Our final model is below:

class BlogRollLink(models.Model):
    name = models.CharField(max_length=128)
    name_size = models.IntegerField(editable=False)
    date_added = models.DateTimeField(default=datetime.now)
    url = models.URLField()

    def save(self):
        self.name_size = len(self.name)
        super(BlogRollLink, self).save()

    def __unicode__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

    class Admin:
        pass

Now to display this on every page, I've created a context processor named blogroll_processor. It looks like this:

def blogroll_processor(request):
    blogrolls = cache.get('blogrolls', None)
    if blogrolls == None:
        blogrolls = list(BlogRollLink.objects.all().order_by('name_size'))
        cache.set('blogrolls', blogrolls)
    return {'blogrolls' : blogrolls}

And we're done! A nifty "waterfall" of blogs. Let me know what you think about this technique. Is it stupid?

Interesting Discussion, Nginx

Very interesting discussion going on right now about Django's templating language and whether to split it off into its own separate library. One of the justifications is that it will "feel" easier to plug in other template languages into Django itself. Funny how I just blogged about how easy this is already.

Also, previously this site was run with apache2 and perlbal. Now it's running apache2 and nginx. At some point I'm going to make the switch to having all of the media pointing to an nginx-only server which short circuits the mod_python (also soon to be mod_wsgi, lol) handlers altogether.

Sorry that this is another in a line of short posts, but I expect this trend will continue as I move twice in the next 2 weeks. Crazy stuff happening in my life right now!

Search

Badges

  • django badge
  • apache badge
  • GeoURL
  • XFN Friendly
  • Valid HTML 4.01 Transitional