How to connect the database in web2py from the external python script

26 views
Skip to first unread message

mrry...@csu.fullerton.edu

unread,
Jun 12, 2019, 10:49:31 AM6/12/19
to web2py-users
How to connect the database in web2py from the external python script? please help Thanks

Jim S

unread,
Jun 12, 2019, 12:38:41 PM6/12/19
to web2py-users
One way is to write the script just like a web2py controller but call it from web2py.  See here:  http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options

Look at the -S, -M and -R options.

Another way is to import the DAL (http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Using-the-DAL-stand-alone-) and auto_import your definitions.

What have you tried?

What specific problems are you seeing?

-Jim
Reply all
Reply to author
Forward
0 new messages