*case 1*
*models/db.py*
from gluon.contrib.memcache import MemcacheClient
memcache_servers = myconf.get(myconf_env + '_' + 'cache.memcache_servers')
cache.memcache = MemcacheClient(request, memcache_servers)
auth.settings.actions_disabled = myconf.get(myconf_env + '_' +
'auth.actions_disabled')
*private/appconfig.ini*
[dev_cache]
memcached_servers = ['192.168.x.x:11211']
[dev_auth]
actions_disabled = ['profile', 'register', 'change_password',
'request_reset_password']
why the appconfig is work for action disabled while for memcached servers
is not work?
error traceback :
TypeError: 'NoneType' object is not iterable
*case 2*
*e.g. 1*
*models/db.py*
from gluon.contrib.redis_utils import RConn
from gluon.contrib.redis_cache import RedisCache
rconn = RConn(myconf.get(myconf_env + '_' + 'cache.redis_server'),
myconf.get(myconf_env + '_' + 'cache.redis_port') )
cache.redis = RedisCache(redis_conn = rconn, debug = True)
from gluon.contrib.redis_session import RedisSession
sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
session.connect(request, response, db = sessiondb)
auth = Auth(db, host_names = myconf.get(myconf_env + '_' + 'auth.host') )
work fine for login because redis is define before auth
*e.g. 2*
auth = Auth(db, host_names = myconf.get(myconf_env + '_' + 'auth.host') )
from gluon.contrib.redis_utils import RConn
from gluon.contrib.redis_cache import RedisCache
rconn = RConn(myconf.get(myconf_env + '_' + 'cache.redis_server'),
myconf.get(myconf_env + '_' + 'cache.redis_port') )
cache.redis = RedisCache(redis_conn = rconn, debug = True)
from gluon.contrib.redis_session import RedisSession
sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
session.connect(request, response, db = sessiondb)
status login unsure, no error occured but the logged in user on the top
right is not shown but the session flash hello world is appear
different in case 2 e.g. 1 and e.g 2 is in the order, e.g. 1 define redis
session first then define auth, while in e.g. 2 define auth first then
define redis session.
*question 1 :*
is it normal we must define redis cache and session first then auth ?
*question 2 :*
in book rconn = RConn('localhost', 6379), is it ok for me to put it on
appconfig.ini like examples above?
thanks and best regards,
stifan
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.