Style: Normal Dark

Django 1.0!

Written by Jason Davies Topics: django, programming, python

Finally, Django 1.0 is released!

After countless hours of hard work by many talented people, it is a pleasure to see the long-awaited version 1.0 released to the world. Finally, a version number that reflects the quality of the codebase, which in fact I have been using in production for many months.

New features that I am excited about include:

Re-factored admin application

Developed under the newforms-admin branch for a long while, the re-factored admin application is much more customisable and means I don't have to do so many ugly hacks and workarounds any more. See the admin reference for details.

Re-factored ORM

The internals of the ORM were pretty much rewritten from scratch in the queryset-refactor branch, resulting in many annoying bugs being fixed. This also includes support for model inheritance, which allows for more elegant models. See the wiki for more details.

Have fun!

1 comment

Django Code_Swarm

Written by Jason Davies Topics: django, video

Awesomeness, from Brian Rosner:


Django code_swarm from Brian Rosner on Vimeo.

0 comments

DebugFooter Middleware for Django

Written by Jason Davies Topics: debugfooter, django, middleware

DebugFooter is a handy little piece of middleware that Simon mentioned during his talk on Monday.

Adds a hidden footer to the bottom of every text/html page containing a list of SQL queries executed and templates that were loaded (including their full filesystem path to help debug complex template loading scenarios).

To use, drop in to a file called 'debug_middleware.py' on your Python path and add 'debug_middleware.DebugFooter' to your MIDDLEWARE_CLASSES setting.

0 comments

Django: An Introduction

Written by Jason Davies Topics: django, programming, slides

Slides from my PyCon UK 2007 tutorial are now online (with audio):

0 comments

Pinging Technorati and Google with Django

Written by Jason Davies Topics: blog, django, google, technorati

This simple Django snippet demonstrates how to ping Technorati and Google when a blog post has been added or updated.

import xmlrpclib

from django.core import urlresolvers
from django.db.models import signals
from django.dispatch import dispatcher

from django.contrib.sites.models import Site

def send_pings(sender, instance):
    base_url = 'http://%s' % Site.objects.get_current().domain
    blog_url = '%s%s' % (base_url, urlresolvers.reverse('blog-index'))
    entry_url = '%s%s' % (base_url, instance.get_absolute_url())
    # Ping Technorati
    j = xmlrpclib.Server('http://rpc.technorati.com/rpc/ping')
    reply = j.weblogUpdates.ping('Jason Davies', entry_url)
    # Ping Google Blog Search
    j = xmlrpclib.Server('http://blogsearch.google.com/ping/RPC2')
    reply = j.weblogUpdates.ping('Jason Davies', blog_url, entry_url)

dispatcher.connect(send_pings, sender=Entry, signal=signals.post_save)

0 comments

Powered by Django.