Style: Normal Dark

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

  • Recent Comments

    Joel

    Wow, this is so much fun!!

    Jason

    I think all the scenes in the video actually come preloaded with the program.

    It was a lot of fun to play with, and certainly something I'd recommend for children to use when learning about physics, or just for general entertainment on a rainy day!

    grinnyguy

    That looks like a wonderful program. I will definitely download it sometime and have a go! Were the ones you made as good as the ones in the video?

    Eric

    Thank you so much. Got same problem with OpenSuse 10.3, Firefox 2.0.0.12 & JDK 1.6 and now it works fine !

    James Low

    It may not be Christmas, but is it april fools: http://www.isitaprilfools.com

    Faster than you

    you are too slow.

    Jasper Winfield

    Write something once a month dude!

    Joel

    How about only taking macrophotographz?

    (well done for updating your blog!)

    JW

    People don't actually like choices that much. What people REALLY want is a lot of the same thing to choose from, thus creating an illusion of free will, while doesn't really require much of selective process, and in fact what they end up choosing does not matter at all. For example pop music, high street fashion, and the all the major political parties.

    rakie_love

    oh, i am very slightly jealous.

  • Archives

  • Categories

  • Meta

Powered by Django.