This fails on Django 1.4.5. I fixed it locally by wrapping it something like this:

    try:
        from django.utils.encoding import force_bytes as force_str
    except ImportError:
        from django.utils.encoding import force_unicode as force_str