[web2py] Re: how to hash the a users password in bash script

2018-02-04 Thread 黄祥
pls try: *e.g.* *test/controllers/install.py (for running with curl)* def index(): if db(db.auth_permission).isempty() and db(db.auth_membership).isempty(): auth_user_id_1 = db.auth_user.insert(first_name = 'Admin', last_name = 'Admin', email = 'ad...@test.com', username = 'admin', password =

[web2py] Re: how to hash the a users password in bash script

2018-02-04 Thread Anthony
A few options: - Convert the bash script to a Python script. - From the bash script, call a Python script just to do the inserts (using PyDAL in the Python script). - From the bash script, call a Python script just to calculate the hashed password (using the web2py CRYPT

[web2py] Re: how to hash the a users password in bash script

2018-02-03 Thread Massimo Di Pierro
Unfortunately that is not possible. The code you are writing is interpreted by the database. The web2py hash function is implemented in python and based on the pbkdf2 algorithm. I am not aware that it is even possible to implement it in postgresql. On Monday, 22 January 2018 09:10:07 UTC-6,