简体   繁体   中英

How to start server in debug mode - Pycharm

I want to debug my code and put breakpoints. However I am not able to start my server in debug mode.

I have a setup.sh file. It has multiple export statements and last statement is python manage.py runserver. In manage.py I added DEBUG = True as shown below :

if __name__ == "__main__":
 DEBUG = True

The application did not stop on debug points i had put.

Alternatively, you may use the python "pdb" debugger. Just import pdb and call pdb.set_trace() below the line which might cause error. It will stop at the that point of code during execution and you can debug and see whatever you want to!

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