# serializers.py  
from kombu.serialization import register
import pickle

def pickle_v2_dumps(obj):
    return pickle.dumps(obj, protocol=2)

def pickle_v2_loads(s):
    return pickle.loads(s)

register(
    'pickle_v2',
    pickle_v2_dumps,
    pickle_v2_loads,
    content_type='application/x-pickle',
    content_encoding='binary',
)

