简体   繁体   中英

Profiling Django with PyCharm

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM