[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread Alex Beskopilny
You are right , sym-link is simple example. In multi-python multi-web2py envs I use to full path to python (centos 7 /etc/systemd/syste/gunicorn.service) --- [Unit] Description=Gunicorn instance to serve web2py After=network.target [Service] User=w2p Group=w2p WorkingDirectory=/home/w

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread 黄祥
## miniconda on osx # Download and Install Package cd ~/Downloads curl -L -O -C - https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh bash Miniconda*.sh yes yes # Load New Path source ~/.bash_profile # Update Package conda update -n base conda # Create Environment conda crea

[web2py] Re: use database that build using web2py in another app

2018-05-18 Thread 黄祥
thanks anthony, as expected, from web2py, the crypt algorithm is secure (not just simple step to store the sensitive one), i'll try your second advice (using web2py as cas provider) first, because it simple than the first advice. thanks and best regards, stifan On Saturday, May 19, 2018 at 3:3

[web2py] Re: how to validate field that depend on each other in the model rather than form

2018-05-18 Thread Enrique Almeida Maldonado
Hello, I had the same problem and I've just found an elegant solution for it. First, you neet to notice that before any validation, the values of the fields travel to the model, so, in the model you can manipulate them throug the *request.vars* . After that everything else is easy: Just create a

[web2py] Re: use database that build using web2py in another app

2018-05-18 Thread Anthony
Note, you might also consider using web2py as a CAS provider from your other apps, letting web2py handle all the authentication logic. On Friday, May 18, 2018 at 3:05:33 PM UTC-4, Anthony wrote: > > He

[web2py] Re: Internal only functions in controllers

2018-05-18 Thread Anthony
On Friday, May 18, 2018 at 11:44:53 AM UTC-4, Rick Williams wrote: > > Thanks, Stifan. I verified double underscore returns invalid function. > This will work for me. > Also, note that any function in a controller that takes arguments is also kept private, so the double underscore is only need f

[web2py] Re: use database that build using web2py in another app

2018-05-18 Thread Anthony
Here is the code the compares a plain text password to the stored hashed password: https://github.com/web2py/web2py/blob/4ed36cfb1fe960d5c818c53562d920d407e991ae/gluon/validators.py#L2919-L2922 The salt and the digest algorithm name and parameters are stored in a string combined with the hash.

[web2py] Re: New table fields don't show

2018-05-18 Thread Luís Guilherme F
SOLVED. I'm terribly sorry. It was my mistake. The reason for all these problems was that I had made a "lazy" backup of the old model file in a sub-folder, and it was also being interpreted, at: models/_versions/tab_9may2018.py I just found this looking at administrative interface. It's a sil

[web2py] Re: Internal only functions in controllers

2018-05-18 Thread Rick Williams
Thanks, Stifan. I verified double underscore returns invalid function. This will work for me. On Friday, May 18, 2018 at 11:25:34 AM UTC-4, 黄祥 wrote: > > think there are 2 solution for this: > 1. use double underscore as a function name in controller e.g. def > __validate_function() > 2. use mod

[web2py] use database that build using web2py in another app

2018-05-18 Thread 黄祥
*objective:* use database that built using web2py in another app, like php slim framework, express js or restify, since that frameworks didn't need to define the models database. *problem:* don't know how to use the auth_user table for login in another app, because the password field is not cle

Re: [web2py] IS_LENGTH does not work with "list:string"

2018-05-18 Thread Martin Weissenboeck
Thank you very much. I have read the book very often, but I did not remember this chapter. 2018-05-18 17:03 GMT+02:00 Anthony : > On Wednesday, May 16, 2018 at 1:35:02 PM UTC-4, mweissen wrote: >> >> I understand that there is no DEFAULT VALIDATOR for 'list:string', but it >> seems that is not po

[web2py] Re: Internal only functions in controllers

2018-05-18 Thread 黄祥
think there are 2 solution for this: 1. use double underscore as a function name in controller e.g. def __validate_function() 2. use modules (e.g. modules/somemodule.py) and import it on the controller or function that need that module best regards, stifan -- Resources: - http://web2py.com - h

[web2py] Internal only functions in controllers

2018-05-18 Thread Rick Williams
Hi All, Somehow I got the impression that functions in controllers that started with the "_" would not be exposed to be called when a user goes to that url. Like "https://myserver/myapp/mycontroller/_something";. But I've since realized this was a wrong impression. Is there a means to define f

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread 黄祥
> > you missed > adduser pyuser > sudo su pyuser > yes, you are right, the step above was tested using root account and running smoothly, and as per your advice it's safest to do it using user privilege not root login. will try in osx soon, for the size of python 3 ampps in osx around 136mb,

Re: [web2py] IS_LENGTH does not work with "list:string"

2018-05-18 Thread Anthony
On Wednesday, May 16, 2018 at 1:35:02 PM UTC-4, mweissen wrote: > > I understand that there is no DEFAULT VALIDATOR for 'list:string', but it > seems that is not possible to use IS_LENGTH at all. > See the end of this section: http://web2py.com/books/default/chapter/29/07/forms-and-validators#V

[web2py] Re: restful service + auth on same application/ different controllers = gives Not authorized message

2018-05-18 Thread 黄祥
> > allows_jwt means JWT is *allowed*, not that it is *required*. When you >> open the URL in the browser, you will have access as long as you are logged >> in in the browser -- JWT is irrelevant in that context. >> > > Just to clarify, you *can* use JWT for authentication even from the > brows

[web2py] Re: create users manually

2018-05-18 Thread Anthony
On Friday, May 18, 2018 at 10:48:35 AM UTC-4, Joe Willrich Lutalo wrote: > > Thanks, but in the typical application structure, where would you place > these function invocations? > It is up to you, depending on your desired workflow. auth.bulk_register() produces a form, so the idea would be to

[web2py] Re: create users manually

2018-05-18 Thread Joe Willrich Lutalo
Thanks, but in the typical application structure, where would you place these function invocations? In my case, am working on an existing application instance, and want to easily add a new user into the db, if possible, merely overriding the password of an existing account with a new one. Just

[web2py] Re: restful service + auth on same application/ different controllers = gives Not authorized message

2018-05-18 Thread Anthony
> > allows_jwt means JWT is *allowed*, not that it is *required*. When you > open the URL in the browser, you will have access as long as you are logged > in in the browser -- JWT is irrelevant in that context. > Just to clarify, you *can* use JWT for authentication even from the browser, but

Re: [web2py] European General data protection act and web2py

2018-05-18 Thread António Ramos
you can check if web2py is using cookies Just open dev console and find the cookie session_id... Also google for cookie policy , you will find a lot of examples on the internet just google for examples and create one that suits your needs and meets the GDPR regulation.. Regards 2018-05-18 8:40

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread Alex Beskopilny
you missed adduser pyuser sudo su pyuser :( вторник, 8 мая 2018 г., 3:11:37 UTC+3 пользователь 黄祥 написал: > > plan to test web2py both python2 and python3 in 1 machine, any idea how to > do that in the safety way? > already googling found this: > > brew update > brew install python > brew i

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread 黄祥
*# miniconda on ubuntu (around 50mb)* apt update apt install -y curl curl -L -O -C - https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda*.sh yes yes source ~/.bashrc conda update -n base conda y conda create --name mypython3 python=3 y ln -s ~/miniconda3/envs

Re: [web2py] Re: Controller to Ajax Function AND View

2018-05-18 Thread Gualter Portella
Great, Anthony. I will give it a try and let you know the result. Thanks. Enviado do meu iPhone Em 17 de mai de 2018, à(s) 17:08, Anthony escreveu: > If you just want to avoid duplicating code to create the "income" variable, > you could simply extract that into a separate function and call

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread Alex Beskopilny
use anaconda . 1 adduser pyuser 2 su pyuser 3 install anaconda https://conda.io/miniconda.htmlto ~/opt 4 conda create --name mypython3 python=3 ln -s ~/.conda/envs/mypython3/bin/python3 ~/bin/mypy3 5 conda create --name mypython2 python=2 ln -s ~/.conda/envs/mypython2/bin/pytho

[web2py] Re: ipython notebook and web2py

2018-05-18 Thread LMK
Anthony, Thanks a lot too! Best, LMK -- 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 Googl

[web2py] European General data protection act and web2py

2018-05-18 Thread BlueShadow
Hi, I am using a fairly old version of web2py since the page is running since 2012 I haven't done many updates. (since I ran into a world of trouble last time I tried to upgrade it I stayed at version 2.14.6) Can you tell me if the web2py is using cookies? Has anyone a cookie warning implemented