python - Web API in Flask -
i want utilize flask create web api application, have problems create flask app aware of other objects.
i want utilize flask in order able interact application through http requests. whole flask application in case just external api, , relies on core application. let's imagine flask application have to perform database calls. to manage database calls in application, utilize single object connects db ans implements kind of queue. that means core application running in background has reference db object in order create db calls. this done giving reference queue object core application. now i want able perform actions on db using flask application too.what right way pass reference queue object flask application?
if define objects @ module level, have no way interact them afterwards, i?
all illustration of flask applications utilize flask core of scheme , define in app on module level. how create flask part of app? thx!
i'm not sure mean
if define objects @ module level, have no way interact them afterwards, i?
but no, don't have define objects @ module level - that's true of flask instance, blueprints , object provide. illustration can create appbuilder class makes , configures flask instances.
for interactions context locals handy tool well.
if can clarify issue i'll seek expand answer.
python api web flask
No comments:
Post a Comment