Profiling Django with PyCharm

做~自己de王妃 提交于 2020-08-04 04:45:26

问题


My app is pretty slow even in a dev environment so I would like to figure out what's slowing it down so I can try and fix it.

I know about the debug toolbar and according to what it reports neither the database queries nor the downloaded sources are the issue, so it must be the business logic.

However, I cannot run the PyCharm profiler with the Django server because, well, it's not like running a script.

How may I profile Django with PyCharm?


回答1:


You should probably set configuration properly.

Then click on Edit Configurations...

The main thing is to set Interpreter (your virtual environment). You don't have to set Custom Run Command if you use python manage.py runserver

Then you can run Django server directly from PyCharm ann Profiler too.



来源:https://stackoverflow.com/questions/39770504/profiling-django-with-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!