1、打开你的工程,在菜单栏里找到Run-->Edit Configurations

2、在打开的对话框里边选择Python,点击"+"号

3.选择python

4、出现了一个新的项Unnamed,你可以把它改名叫debug,好听一点

5、脚本选择你网站的manage.py,脚本参数用runserver,跟你平常用命令行是一样的,聪明的同学应该已经发现了,也可以配置migrate(数据库同步)等等命令参数,来实现命令的快速运行,省的手敲了

6、之后在菜单栏里找到Run-->Debug'debug',并点击

7、运行后,你能在Console中看到服务器已经运行起来了,有日志打印
、

8、之后在你的程序里打断点试试吧,当程序运行到你的断点就会定住了,愉快的调试吧!

网友评论