In 19 ctx1 pop In 20 Out 20 LocalProxy unbound In 21 current_app Out 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
In [19]: ctx1.pop()
In [20]: g
Out[20]: <LocalProxy unbound>
In [21]: current_app
Out[21]: <LocalProxy unbound>
In [22]: ctx2.push()
In [23]: g.get('first')
In [24]: g.get('first', 'нету!')
Out[24]: '\xd0\xbd\xd0\xb5\xd1\x82\xd1\x83!'
In [25]: print g.get('first', 'нету!')
нету!
In [26]: ctx1.push()
In [27]: current_app
Out[27]: <Flask 'first'>
In [28]: g.first1 = 11
In [29]: ctx1.push()
In [30]: ctx2.push()
In [31]: current_app
Out[31]: <Flask 'second'>
In [32]: g.second = 222
In [33]: print g.get('first', 'нету!')
нету!
In [34]: