Lightrun for Django🔗
To run a Django web server with the Lightrun agent, follow these steps:
- In your application folder, install the Python agent by running
python -m pip install lightrun -
Add the following code to your
manage.pyfile:try: if os.environ.get('RUN_MAIN') or '--noreload' in sys.argv: import lightrun lightrun.enable(company_key="<COMPANY_SECRET>") except ImportError as e: print("Error importing Lightrun: ", e) -
Run your Django application as normal.
An alternative
enable()argument is:lightrun.enable (com_lightrun_server="https://<SERVER_DOMAIN>/", company_key="<COMPANY_SECRET>")
Last update: February 22, 2026