i have a code :
*controllers/install.py*
import test_install_insert
def index():
if db(db.auth_permission).isempty() and db(db.auth_membership).isempty():
test_install_insert
session.flash = T('Installation Done')
redirect(URL('default', 'index') )
*modules/test_install.py*
import sys;
sys.path.append('site/web2py/')
from gluon import current
from gluon.contrib.webclient import WebClient
install = WebClient('http://127.0.0.1:8000/mutualfunds/install/',
postbacks = True)
install.get('index')
if current.T('Installation Done', lazy = False) in install.text:
print current.T('Installation Done', lazy = False)
else:
print current.T('Installation Failed', lazy = False)
*modules/test_install_insert.py*
from gluon import current
current.db.auth_user.bulk_insert([
{"first_name" : "Admin", "last_name" : "Admin",
"email" : "[email protected]", "username" : "admin",
"password" : current.db.auth_user.password.validate("password")[0] }, ] )
*Run Web2py on terminal 1*
python ~/site/web2py/web2py.py
*Install New Web2py app on terminal 2*
rm -rf ~/site/web2py/applications/test
cp -R ~/site/web2py/applications/welcome/ site/web2py/applications/test
rsync -zavr ~/Cloud/Dropbox/Programming/Python/Web2py/*
~/site/web2py/applications/
rsync -zavur ~/Cloud/Dropbox/Programming/Python/Web2py/*
~/site/web2py/applications/
python ~/site/web2py/web2py.py -S test -M -R
~/site/web2py/applications/test/modules/test_install.py
*Install New Web2py app on terminal 3 (takes long time)*
rm -rf ~/site/web2py/applications/test
cp -R ~/site/web2py/applications/welcome/ site/web2py/applications/test
rsync -zavr ~/Cloud/Dropbox/Programming/Python/Web2py/*
~/site/web2py/applications/
rsync -zavur ~/Cloud/Dropbox/Programming/Python/Web2py/*
~/site/web2py/applications/
python ~/site/web2py/web2py.py -S test -M -R
~/site/web2py/applications/test/modules/test_install_insert.py
What i want to achieve is i like to install new web2py app either from
browser or from terminal
My question is why when i running web2py module from terminal 3 takes long
time rather than execute from terminal 2?
is it thread safe to have a code like test_install_insert.py?
thanks 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 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 [email protected].
For more options, visit https://groups.google.com/d/optout.