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 validator), passing the value back 
   to a bash variable.

Anthony

On Monday, January 22, 2018 at 10:10:07 AM UTC-5, lucas wrote:
>
> hello one and all,
>
> I'm creating a bash script that creates the new db with indexes, 
> functions, etc. using Postgresql 9.2 for the DAL to use in web2py 2.16.1.
>
> as it stands now, the script works great and even creates the tables 
> properly as setup in db.py, etc.
>
> I would like to insert some users into auth_user under that bash script 
> like:
>
> #!/bin/bash
> psql db postgres << EOF
> insert into auth_user (first_name, last_name, email, password) values 
> ('Harry', 'Truman', 'htru...@gmail.com', w2p_hash_passwd('dude man'));
> EOF
> exit 1
>
> the w2py_hash_passwd is obviously not real, but what would I replace it 
> with so that when harry types in the 'dude man' password, web2py hashes it 
> properly and logs in old harry?
>
> thank you in advance, lucas
>

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

Reply via email to