Thanks for comments. Currently, I do not want to use SQLAlchemy to import another library. So there is no other way?
On Thu, Jul 9, 2015 at 12:00 PM, INADA Naoki <[email protected]> wrote: > I use SQLAlchemy's engine. > http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html > > On Thu, Jul 9, 2015 at 11:56 AM, Jerry OELoo <[email protected]> wrote: >> >> Hi. >> I am using uWSGI + Flask to provide web API. >> In my web api, it will store some data into database. >> So I want to keep my database connection in whole Application lifetime. >> From docs http://flask.pocoo.org/docs/0.10/tutorial/dbcon/ >> It suggests create connection in before_request(),and release in >> after_request(), but as these two functions will called in each >> request, as my understand, it will connect/close database connection >> at each request. if so, It is still not keep database connection, I >> want to keep database connection when uWSGI start, and close database >> connection when uWSGI stop. >> Is there any way that can meet my request, and How to? >> >> Thanks~ >> >> -- >> Rejoice,I Desire! >> _______________________________________________ >> uWSGI mailing list >> [email protected] >> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi > > > > > -- > INADA Naoki <[email protected]> > > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi > -- Rejoice,I Desire! _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
