one more try?
On Sunday, 28 April 2019 15:41:42 UTC-7, 黄祥 wrote: > > still got an error for store session in redis after update the > *_scaffold/controllers.py* > ... > elif settings.SESSION_TYPE == 'redis': > import redis > host, port = settings.REDIS_SERVER.split(':') > conn = redis.Redis(host=host, port=int(port)) > *conn**.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: > (cs(key,value), ct(expiration))* > session = Session(secret=settings.SESSION_SECRET_KEY, storage=conn) > ... > > not tested the memcached again, since, seems it's not updated yet. > > *test redis session without password in redis.conf* > ERROR:root:Traceback (most recent call last): > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in > wrapper > [obj.on_success() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in > <listcomp> > [obj.on_success() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in > on_success > self.save() > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in > save > self.storage.set(cookie_data, json.dumps(self.local.data), self. > expiration) > File > "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", > line 18, in <lambda> > conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs( > key,value), ct(expiration)) > NameError: name 'expiration' is not defined > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 353, in > wrapper > ret = func(*func_args, **func_kwargs) > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in > wrapper > [obj.on_error() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 328, in > <listcomp> > [obj.on_error() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 270, in > on_error > self.save() > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in > save > self.storage.set(cookie_data, json.dumps(self.local.data), self. > expiration) > File > "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", > line 18, in <lambda> > conn.set = lambda key, value, expire, cs=conn.set, ct=conn.ttl: (cs( > key,value), ct(expiration)) > NameError: name 'expiration' is not defined > > id= 6 > > *test redis session with password in redis.conf* > ERROR:root:Traceback (most recent call last): > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in > wrapper > [obj.on_success() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 325, in > <listcomp> > [obj.on_success() for obj in fixtures] > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 274, in > on_success > self.save() > File "/Users/sugizo/learn/python/web3py/web3py/core.py", line 250, in > save > self.storage.set(cookie_data, json.dumps(self.local.data), self. > expiration) > File > "/Users/sugizo/learn/python/web3py/applications/_scaffold/controllers.py", > line 18, in <lambda> > conn.set = lambda key, value, expire, cs=<span style="color: #000;" > clas > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.