[web2py] Re: redis in 2.16.1

2018-06-29 Thread 黄祥
yes, can do, no problem on redis part
$ ./src/redis-cli -h localhost -p 6379 -a password
Warning: Using a password with '-a' option on the command line interface 
may not be safe.
localhost:6379> ping
PONG
localhost:6379> 

$ ./src/redis-cli -a password monitor
Warning: Using a password with '-a' option on the command line interface 
may not be safe.
OK
1530331699.614717 [0 127.0.0.1:53577] "AUTH" "password"
1530331699.615113 [0 127.0.0.1:53577] "COMMAND"
1530331707.001400 [0 127.0.0.1:53577] "ping"

*step i took on redis (dev env)*
curl -L -O -C - http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
sed -i '' 's/# requirepass foobared/requirepass password/g' redis-stable/
redis.conf
mv redis-stable/ redis
cd redis
make
./src/redis-server ./redis.conf

*note:*
- ResponseError: invalid DB index problem occured when using session for 
new web2py app. no error occured when using redis session and redis cache 
on existing web2py app.
- ResponseError: NOAUTH Authentication required. problem occured when 
activate password on redis server (requirepass), when comment requirepass 
on redis.conf, no error occured

any clue?

thx n 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Infinite loading

2018-06-29 Thread Carlos Cesar Caballero Díaz
Thanks Leonel, I am trying to build a generic solution, if everything 
goes fine I will share.


Greetings.


El 28/06/18 a las 13:40, Leonel Câmara escribió:
You should probably use the intersection observer now but here's a 
particularly stupid way to do it (also because it fires for every scroll).


|
varscroll_threshold =500;// make sure you leave enough for any 
elements after the one where you are loading elements such as a footer


document.onscroll=function(){
    let scrollerBottom,listBottom;
    scrollerBottom =$(window).scrollTop()+$(window).height()
    listBottom =$(document).height();
if(listBottom -scrollerBottom // Then you request the next page of results using ajax e.g. see 
jquery $.get or $.web2py.page


}
};
|


--
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.


--
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.


[web2py] Re: redis in 2.16.1

2018-06-29 Thread Leonel Câmara
Have you set password "password" for localhost using redis-cli?

redis-cli -h localhost -p 6379 -a password 

-- 
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.


Re: [web2py] redis in 2.16.1

2018-06-29 Thread 黄祥

>
> Is in your issue web2py the only moving part?? Nothing change on OS and 
> Redis side??
>
 
for existing app it works (same web2py version, same os and same redis 
server), but when start new web2py app it return an error. 
ResponseError: invalid DB index


> As it mention in the final trace back above there seems to need a password 
> to be setup in your redis connection string... Perhap you forgot that you 
> set one or there is a default one defined in you Linux box or in the new 
> version of Redis
>
 
for password it's still not work even in existing app, i suspect is wrong 
with my configuration, not sure
*redis.conf*
requirepass password

*models/db.py*
rconn = RConn('localhost', 6379, 'password')

*result*
ResponseError: NOAUTH Authentication required.

any hints for password error? how to setup a password in redis connection 
string?

thx n 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: LDAP Authentication never work

2018-06-29 Thread 黄祥
i've test it without change auth = Auth(db) in db.py
the logs is depend on your ldap server configuration (389-ds, openldap, 
etc), that's why i in another thread, i start the ldap server directly (no 
daemonize), so that every single hit (whatever try to reach the ldap 
server, success or not will print on the terminal)
not sure what going on with your side, because no logs or error provided 
(web2py or ldap server).
my suggestion is pls start from simple first, in your dev env :
- create your ldap server (apacheds not hurt, just download and run it, no 
installation like 389-ds or openldap)
- run apacheds from terminal, create a ou (whatever you want in ldap 
server, preferable using apache directory server or you can use slapd)
- create new web2py app
- copas about ldap auth from web2py book (link provide on prev message)

then if still can not, pls come back with the error log shown in ldap 
server (apacheds terminal)

good luck n 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: LDAP Authentication never work

2018-06-29 Thread Suhas Jadhav
In db.py i have auth = Auth(db)
Do i need to change this for ldap_auth to work?

Thanks,
Suhas

On Fri, Jun 29, 2018 at 1:35 PM Suhas Jadhav  wrote:

> It is still not working for me,
> Is there a way to see the logs? I want to see if ldap_auth is not able to
> contact my ldap server or any other reason
>
>
> Thanks,
> Suhas
>
> On Fri, Jun 15, 2018 at 6:46 PM 黄祥  wrote:
>
>> it should work (ignore configuration on previous message), pls follow
>> this thread discussion for detail or read the book:
>> ref:
>> https://groups.google.com/forum/#!topic/web2py/tWa5BPDMglk
>>
>> http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms
>>
>> 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 web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.


Re: [web2py] Re: LDAP Authentication never work

2018-06-29 Thread Suhas Jadhav
It is still not working for me,
Is there a way to see the logs? I want to see if ldap_auth is not able to
contact my ldap server or any other reason


Thanks,
Suhas

On Fri, Jun 15, 2018 at 6:46 PM 黄祥  wrote:

> it should work (ignore configuration on previous message), pls follow this
> thread discussion for detail or read the book:
> ref:
> https://groups.google.com/forum/#!topic/web2py/tWa5BPDMglk
>
> http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms
>
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.


Re: [web2py] redis in 2.16.1

2018-06-29 Thread Richard Vézina
Is in your issue web2py the only moving part?? Nothing change on OS and
Redis side??

As it mention in the final trace back above there seems to need a password
to be setup in your redis connection string... Perhap you forgot that you
set one or there is a default one defined in you Linux box or in the new
version of Redis

Richard

On Tue, Jun 19, 2018 at 9:17 PM, 黄祥  wrote:

> it seems session with redis not work in 2.16.1
> *e.g. create web2py from scratch name redis*
> *models/db.py*
> from gluon.contrib.redis_utils import RConn
> from gluon.contrib.redis_cache import RedisCache
> from gluon.contrib.redis_session import RedisSession
> rconn = RConn('localhost', 6379)
> cache.redis = RedisCache(redis_conn = rconn, debug = True)
> sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
> session.connect(request, response, db = sessiondb)
>
> *result in browser http://localhost:8000/redis/default/index
> *
> Traceback (most recent call last):
>   File "/Users/sugizo/web2py/gluon/main.py", line 461, in wsgibase
> session._try_store_in_db(request, response)
>   File "/Users/sugizo/web2py/gluon/globals.py", line 1224, in
> _try_store_in_db
> record_id = table.insert(**dd)
>   File "/Users/sugizo/web2py/gluon/contrib/redis_session.py", line 137, in
> insert
> newid = str(self.db.r_server.incr(self.serial))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 1011, in incr
> return self.execute_command('INCRBY', name, amount)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 667, in execute_command
> connection.send_command(*args)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 610, in send_command
> self.send_packed_command(self.pack_command(*args))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 585, in send_packed_command
> self.connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 493, in connect
> self.on_connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 567, in on_connect
> if nativestr(self.read_response()) != 'OK':
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 629, in read_response
> raise response
> ResponseError: invalid DB index
>
> also, is it possible to use redis secured with password in web2py?
> *e.g.*
> *redis.conf*
> requirepass password
>
> *models/db.py*
> rconn = RConn('localhost', 6379, 'password')
> #sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
> #session.connect(request, response, db = sessiondb)
>
> *result in browser http://localhost:8000/redis/default/index
> *
> Traceback (most recent call last):
>   File "/Users/sugizo/web2py/gluon/main.py", line 461, in wsgibase
> session._try_store_in_db(request, response)
>   File "/Users/sugizo/web2py/gluon/globals.py", line 1224, in
> _try_store_in_db
> record_id = table.insert(**dd)
>   File "/Users/sugizo/web2py/gluon/contrib/redis_session.py", line 137, in
> insert
> newid = str(self.db.r_server.incr(self.serial))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 1011, in incr
> return self.execute_command('INCRBY', name, amount)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 667, in execute_command
> connection.send_command(*args)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 610, in send_command
> self.send_packed_command(self.pack_command(*args))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 585, in send_packed_command
> self.connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 493, in connect
> self.on_connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 567, in on_connect
> if nativestr(self.read_response()) != 'OK':
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 629, in read_response
> raise response
> ResponseError: NOAUTH Authentication required.
>
> any hints?
>
> thx 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 

Re: [web2py] Re: Nonetype Error

2018-06-29 Thread Maurice Waka
Thanks for the help.
Be blessed

On Fri, 29 Jun 2018, 17:03 Leonel Câmara  wrote:

> Well if you just want to capture the error you simply need to put stuff
> inside a try/except.
>
> try:
> # your stuff
> except TypeError:
> # other stuff you do when the error happens
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/KRSp3bD-LDU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.


[web2py] Re: Nonetype Error

2018-06-29 Thread Leonel Câmara
Well if you just want to capture the error you simply need to put stuff 
inside a try/except.

try:
# your stuff
except TypeError:
# other stuff you do when the error happens

-- 
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.


Re: [web2py] Re: Nonetype Error

2018-06-29 Thread Maurice Waka
Am using nlp, regex. I just want to capture that error.

On Fri, 29 Jun 2018, 15:41 Leonel Câmara  wrote:

> If you want to do that right you need to do natural language processing
> e.g. using python nltk.
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/KRSp3bD-LDU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.


[web2py] Re: Nonetype Error

2018-06-29 Thread Leonel Câmara
If you want to do that right you need to do natural language processing 
e.g. using python nltk.

-- 
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.


Re: [web2py] Re: Nonetype Error

2018-06-29 Thread Maurice Waka
Thanks.
What I want is how to reply with a string like:, 'I can not find a reply,
please try again'. Am expecting errors when for example some one types
random figures or letters that the function cannot process. A function can
processe a request such as 'what's your name', but not 'ejududuurjrrh
bjuejhr 1234'
Regards

On Fri, 29 Jun 2018, 13:58 Leonel Câmara  wrote:

> Ok, the error is not there, the error is inside one of the corpus
> functions.
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/KRSp3bD-LDU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.


[web2py] Re: Nonetype Error

2018-06-29 Thread Leonel Câmara
Ok, the error is not there, the error is inside one of the corpus functions.

-- 
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.


Re: [web2py] Re: Nonetype Error

2018-06-29 Thread Maurice Waka
My apologies.I got carried away by an issue.
Cotroller code:
from applications.service.main import get_word, get_name, get_index,
testing
def views:
corpus = [get_name, get_words, get_index, testing]##imported functions
result = ''.join(y for y in [x() for x in corpus] if y is not None)
  return dict(form=form, result=result)

On Thu, Jun 28, 2018 at 9:29 PM Leonel Câmara 
wrote:

> Maurice telling me corpus is defined in the controller doesn't help me at
> all, I need to see how you are picking the functions you put there to see
> why one could be None. A possible reason is that you have a dictionary of
> keys with a function as the value of each key, you then do a get from that
> dictionary which will return a None if the function isn't there.
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/KRSp3bD-LDU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.