Articles tagged with python

  1. Getting Started With Pelican

    Posted on in Software

    I've been using WordPress on this site since 2007. After all this time, I've decided I want to try something new. So, I've decided to go in a completely different direction and start serving static content. There are three things driving my decision to change:

    • The existing site is really …
  2. [Python] Convert String Date to Date Object

    Posted on in Programming

    Occasionally, you may run across a date in a format that can't be easily loaded into a Python date object. For example, I recently had a situation where a file I was parsing was full of dates in this format: 7/7/2008.

    The obvious thing to do here is …

  3. Combining Multiple Models Into One Context Variable

    Posted on in Programming

    Django LogoI'm not sure if the title of this post accurately describes the problem. I have a situation where I have very similar models that I want to display in one table. As you know, querysets are limited to a single model, so it isn't possible to have a single context …

  4. Empty Strings in Python Are False

    Posted on in Programming

    Recently I was working on some old code. One of my model methods was originally written such that if one parameter was set to the Python None type, a particular set of actions would occur. For some reason, I checked for None like this:

    if parameter is None:
        do something …
  5. Django 1.2.3 Released

    Posted on in Programming

    Django LogoThe Django team announced the release of Django 1.2.3 early this morning. All users are encouraged to upgrade as soon as possible.

    This release fixes several problems including:

    • Non-ASCII responses using cross-site request forgery (CSRF) tokens were broken by a patch applied in Django 1.2.2.
    • That …
  6. The Beauty of Python File-like Objects

    Posted on in Programming

    As I mentioned the other day, I'm building a RADIUS client in Python for sending disconnect messages to Cisco routers.

    One hang-up with the pyrad package is that it requires a dictionary file in order to map RADIUS attribute names to codes and types. In the case of my client …

My Bookshelf

Reading Now

Other Stuff