launch.json
如何在Visual Studio代码中运行调试Django应用程序?
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${workspaceRoot}/manage.py",
"cwd": "${workspaceRoot}",
"args": [
"runserver",
"--noreload"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"DjangoDebugging"
]
在浏览器http://localhost:8000/login
我有一个登录页面,允许用户输入用户名和密码登录。我在views.py的代码def login
中加入了一个断点,然后运行调试,但执行不会停在带断点的行上。现在我想允许用户输入用户名和密码,然后点击按钮,它将跳转到views.py中的中断点def login
。我怎样才能做到这一点?
的可能的复制[如何使用Visual Studio代码调试Django的(HTTPS:/ /stackoverflow.com/questions/40937544/how-to-use-visual-studio-code-to-debug-django) –
我很抱歉,但我已经按照你的链接,但它不能运行。那么你能帮我吗?请@WayneJohnston –