def action():
    global pushed
pushed = True
redirect('/button')

def method():
    global pushed
while True:
    if pushed:
        print('push recieved')
pushed = False
method()
приложение для бутылок