Re: [flask] Question on Application Context.
- Armin Ronacher
- 2014-04-17 @ 11:18
On 12/04/2014 19:36, Byungchan An wrote:
> In here, what does it mean by more than one application in the same
> If possible can anyone give example or example codes for this?
It is entirely possible, yes. Simple example:
from flask import Flask
app = Flask(__name__)
return 'Hello World!'
app1 = create_app()
app2 = create_app()
> Also, according to the page, application context can be created for each
> Does it mean each request will be treated as one application?
Each request does something like this:
# request handling code goes here
To switch to another application you can just make an application context
# all code here will now run below other_app instead of app.
# at this point the previous app reactivates.