The blackfire-python
command is being installed along with the Blackfire
pip
package. It can be used to enable the Probe automatically when a profile
is requested, without modifying your code.
Note
No profile is triggered automatically with this command.
To ensure that your application listens to profile requests, you need
to run your webserver through blackfire-python
command.
Example with Django development server:
1 | blackfire-python python manage.py runserver |
Example with Django using gunicorn
:
1 | blackfire-python gunicorn myapp.wsgi |
To be able to run CLI commands and profile them, you need to use
blackfire-python run
command:
1 | blackfire-python run python my_command.py |