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.py
file: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.
Info
An alternative enable()
argument is:
lightrun.enable(com_lightrun_server="https://<SERVER_DOMAIN>/")/company_key<COMPANY_SECRET>
Last update: November 19, 2024