Profiling Django with PyCharm

My application is pretty slow even in dev environment, so I would like to find out what slows it down, so I can try and fix it.

I know about the debug toolbar and in accordance with the fact that it does not report either database queries or loaded sources, so this should be a business logic.

However, I can not start the PyCharm profiler with the Django server, because, well, this is not like running a script.

How can I profile Django with PyCharm?

+5
source share
1 answer

You should probably configure the configuration correctly.

enter image description here

Then click Change Configurations ...

enter image description here

The main thing is to install Interpreter (your virtual environment). You do not need to install Custom Run Command if you use python manage.py runserver

You can then start the Django server directly from PyCharm ann Profiler .

+2
source

Source: https://habr.com/ru/post/1257448/


All Articles