librelist archives

« back to archive

sharing between apps

sharing between apps

From:
Sjoerd Huisman | Congressus
Date:
2013-06-23 @ 09:36
Hi,

 

I have one package with multiple flask apps;

Company (contains a dispatcher, based on URL)

-          Frontend

-          Backend

-          Admin

-          App

-          Core (includes shared models, validators, etc)

 

How is it possible to share a single database instance between all apps for
performance purposes? I have looked into thread locals, but do not really
understand them.

 

Thanks

Re: [flask] sharing between apps

From:
Stefane Fermigier
Date:
2013-06-23 @ 10:37
As far as I understand your problem, you need one app with several 
blueprints, instead of several apps.

Nestable blueprints (cf. https://github.com/mitsuhiko/flask/issues/593 ) 
might help in your situation, but it's easy to work around the fact that 
this still an open proposal.

Regards,

  S.

On Jun 23, 2013, at 11:36 AM, Sjoerd Huisman | Congressus wrote:

> Hi,
>  
> I have one package with multiple flask apps;
> Company (contains a dispatcher, based on URL)
> -          Frontend
> -          Backend
> -          Admin
> -          App
> -          Core (includes shared model s, valid ators, etc)
>  
> How is it possible to share a single database instance between all apps 
for performance purposes? I have looked into thread locals, but do not 
really understand them.
>  
> Thanks

-- 
Stefane Fermigier - http://fermigier.com/ - http://twitter.com/sfermigier 
- http://linkedin.com/in/sfermigier
Founder & CEO, Abilian - Enterprise Social Software - http://www.abilian.com/
Founder & Board Member, Nuxeo - Open Source ECM - http://www.nuxeo.com/
Co-Founder and Chairman, Free&OSS Cluster - http://www.gt-logiciel-libre.org/
Co-Founder & Vice-President, National Council for Free&OSS - http://cnll.fr/
Vice President, Open World Forum 2013 - http://openworldforum.org/
"Well done is better than well said." - Benjamin Franklin
"There's no such thing as can't. You always have a choice." - Ken Gor