Future-proof version:

    try:
        from collections import OrderedDict
    except ImportError:
        from django.utils.datastructures import SortedDict as OrderedDict

Both versions currently exist in the code base :-/