use basestring instead of six.string_types to be compatible with django 1.4.1