django-profiler is util for profiling python code mainly in django projects but can be used also on ordinary python code. It counts sql queries a measures time of code execution. It logs its output via standard python logging library and uses logger profiling. If your profiler name doesn't contain any empty spaces e.g. Profiler('Profiler1') django-profiler will log all the output to the profiling.Profiler logger.
As Profiler context manager gets executed, it can measure number of executed queries. API user should also be able to get list of all SQL queries, that have been executed with manager.
e.g.
with Profiler('sql_profiler') as profiler:
Model.objects.filter(has_attribute=True)
print p.sql_list
While installing django-profiler into environment with django installed, django.core.exceptions.ImproperlyConfigured exception is raised. This is caused by the fact that profiler detects that django is installed and tries to import it. But import fails, because profiler tries to use django unconfigured.
Python 2.7 now contains profile module with virtually the same functionality as profilehook package which uses python-profiles debian package that have installation problems on new ubuntu/xubuntu installations.
Find out if it is even substitutable and if so, substitute it.
File "/Users/Shared/workspace/VOSM/CL_StoreMaps/venv/lib/python3.7/site-packages/profiling/init.py", line 9, in
from StringIO import StringIO
ModuleNotFoundError: No module named 'StringIO'
It was wrongly imported
fromStringIO import StringIO.
Please correct this line in _init.py , line 9 to
from io import StringIO