def session_for_reply_channel(reply_channel):
 reply_name = reply_channel
 hashed = hashlib.md5(reply_name.encode('utf8')).hexdigest()
 session_key = ('chn' + hashed[:29])
 session_engine = import_module(getattr(settings, 'CHANNEL_SESSION_ENGINE', settings.SESSION_ENGINE))
 if (session_engine is signed_cookies):
  raise ValueError('You cannot use channels session functionality with signed cookie sessions!')
 instance = session_engine.SessionStore(session_key=session_key)
 instance._session.keys()
 instance._session_key = session_key
 return instance

def session_for_reply_channel ( reply_channel ) : reply_name = reply_channel hashed = hashlib . md5 ( reply_name . encode ( 'utf8' ) ) . hexdigest ( ) session_key = ( 'chn' + hashed [ : 29 ] ) session_engine = import_module ( getattr ( settings , 'CHANNEL_SESSION_ENGINE' , settings . SESSION_ENGINE ) ) if ( session_engine is signed_cookies ) : raise ValueError ( 'You cannot use channels session functionality with signed cookie sessions!' ) instance = session_engine . SessionStore ( session_key = session_key ) instance . _session . keys ( ) instance . _session_key = session_key return instance
returns a session object tied to the reply_channel unicode string passed in as an argument .