Skip to content

Lightrun for Flask

To run a Flask web app with the Lightrun agent, follow these steps:

  1. In your application folder, install the Python agent by running python -m pip install lightrun
  2. Add the following code to your application's main or (The import statement must be added to the main code, not to a specific routed method):

        import lightrun
    except ImportError as e:
        print("Error importing Lightrun: ", e)
    # Example route
    def hello_world():
    return "Hello world!"

Last update: May 20, 2024