Why not: myconf = AppConfig(configFile=os.path.join(request.folder, '..', 'appconfig' , 'private', 'app0.json'))
Making an HTTP request will add some overhead, though it shouldn't matter as long as you leave the default reload=False -- that way, it will only load the config data from the source once and keep it cached for subsequent requests. Anthony On Tuesday, April 17, 2018 at 11:04:01 PM UTC-4, 黄祥 wrote: > > just curious, is there any performance difference while storing appconfig > in local (private/appconfig.ini) or by using json api that provide by > another web2py app? > *objective* > to create central configuration webapp between web2py app > > *e.g. for json api that provide by another web2py app* > applications/appconfig > applications/a0 > applications/b0 > > so models/db.py in applications a0 and b0 must have something like > *models/db.py* > app_id = 1 #different between app a0 and b0 > import requests > from requests.auth import HTTPBasicAuth > auth = HTTPBasicAuth('admin', 'password') > r = requests.get("http://127.0.0.1:8000/appconfig/api/args_rows_as_json/%s" > % (app_id), auth = auth).json() > db = DAL(r[0]['db_uri'], pool_size = r[0]['pool_size'], migrate = > r[0]['migrate'] ) > > any idea, or comments ? > > 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.