Skip to content

Instantly share code, notes, and snippets.

@ajain352
ajain352 / memcache_storage_flask_openid
Last active September 17, 2016 12:17
Memcache Storage for Flask-OpenId
from openid.store.interface import OpenIDStore
from openid.association import Association
from pymemcache.client.base import Client
# use pymemcache as the memcache client lib.
# memcache client should have way to serializer and deserializer data to and from memcache store. So that we can put python dict in memcache
# pymemcache has this support if in client initialization you pass serializer and deserializer functions.
def json_serializer(key, value):
if type(value) == str: