code: def configure_callbacks(app):
      
  
      @app.before_request
      def before_request():
          """ Retrieve menu configuration before every request (this will return
              cached version if possible, else reload from database. """
  
          from flask import session
  
          #g.menusystem = helper.generate_menusystem()
          session['menusystem'] = helper.generate_menusystem()
          print session['menusystem']
docs: Configure application callbacks