Archives 2013

Metaclasses, what are they good for...

A question was asked at the Django Toronto meetup during the metaclasses talk, basically, "what would you use this for"... so, here's my talk on Metaclasses [pdf] from a PyCon of the Python 2.2 era, which addressed that question at some length (the first half of the presentation). It doesn't secifically mention the use-case cited ...

Continue reading

Docker is the first thing to make me want to update

Kubuntu 12.04 with the kubuntu-backports-precise PPA pretty much keeps right up with KDE changes, so there's very little incentive to update to 13.04 at the desktop level. As a result, I've been happy to keep all of our machines on the LTS.  Until now...

Docker doesn't work reliably without a 3.8 kernel.  12.04's AMD proprietary ...

Continue reading

olwidget show features in the window

So now you've got your spiffy textual-entry-of-GPS-coordinates-and-map admin GUI and you're wanting to actually let people see your "features" on a map.  olwidget has an InfoMap() which is basically a Map + a single InfoLayer, but it uses a static set of "info" rather than a dynamically updating set. Here's how to hack the dynamic ...

Continue reading

olwidget templates...

If you are using olwidget to get your geodjango editing up-and-running fast, and you want your users to be able to enter the GPS coordinates textually, as well as via the map, then yay, I've already gone through the pain for you.  Here is a hacky way to get synchronized text-field and map entry using an ...

Continue reading

GeoDjango is Pretty Straightforward

Doing some trivial GeoDjango today.  All was pretty straightforward, though the tutorial didn't cover how to add PostGIS to an existing DB (you just run the same commands you'd use to create the template against the existing DB, but it needs to be as a DB superuser, so it won't go into a regular migration ...

Continue reading

Okay, spammers, you win

I was just going through and deleting your dozens or hundreds of posts a day using django admin interface, but drat it, you're posting way too many comments and that was taking too long.  You wore me down, so I wrote a stupid little view to kill your comments en-mass.  You win, you wasted part ...

Continue reading

Save/Restore for Embedded Django?

So you've embedded Django in your product lines and you want to provide a save/restore function.  You, of course, are using South migrations, and since you're agile, you often wind up with schema modifications as requirements change.  Since you're managing a lot of products, you want whatever solution you use to be at least somewhat ...

Continue reading

Single Artefact Deployment

The first talk at Django Toronto was on Wave's single artefact deployment mechanism.  Basically it's the Fussy Firmware Packager, but without the signatures.  We use Fussy to be able to send/provide customers with (signed) images that can be loaded on (potentially disconnected) machines (through their web interfaces).

The images include a built virtualenv including ...

Continue reading

Linux Refuses to See the HDMI

My talk at Django Toronto was scuttled by my computer refusing to recognize the HDMI (complained about a checksum failure when the HDMI was plugged in) and the further failure of the VirtualBox image to get onto the network so I could use another machine.  We spent all of the prep time trying to get ...

Continue reading

Fail2ban + Django convenient format

You want to use Django auth failures to generate fail2ban bans to protect against brute-forcing of your passwords. Nothing on django packages... So, you: wrap your login handler with a decorator that logs out messages on failures...

def log_login_failures( function ):
    auth_log = logging.getLogger( 'django.auth' )
    @wraps(function)
    def wrapped( request, *args, **named ):
        result = ...

Continue reading

Monthly archives

Previous year

2012

Next year

2014