如何使用Visual Studio代码调试Django [英] How to use visual studio code to debug django

查看:82
本文介绍了如何使用Visual Studio代码调试Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 django 开发的新手,来自使用 Xcode 和相关IDE进行的台式机/移动应用开发.

I'm new at django development and come from desktop/mobile app development with Xcode and related IDE.

我必须使用Django,我想知道是否存在使用 Visual Studio代码(或 Atom )进行调试的有效方法.

I have to use Django and I was wondering if there was an efficient way to debug it using Visual Studio Code (or Atom).

与Django IDE相关的任何帮助也将有所帮助.

Any help related to Django IDE would be helpful too.

推荐答案

对于VSCode(全面披露,我是VSCode开发人员之一),请尝试安装

For VSCode (full disclosure, I'm one of the VSCode developers) try installing the Python extension to get started.

此文档涵盖了调试Django .应该包含一个调试配置,或者您可以将自己的配置添加到 launch.json文件中:

This documentation covers debugging Django. There should be a included debug configuration or you can add your own to the launch.json file:

{
    "name": "Django",
    "type": "python",
    "request": "launch",
    "stopOnEntry": false,
    "pythonPath": "${config.python.pythonPath}",
    "program": "${workspaceRoot}/manage.py",
    "args": [
        "runserver",
        "--no-color",
        "--noreload"
    ],
    "debugOptions": [
        "WaitOnAbnormalExit",
        "WaitOnNormalExit",
        "RedirectOutput",
        "DjangoDebugging"
    ]
}

Python扩展还提供了许多其他有用的功能.

The Python extension also provide many other features that you may find useful.

希望可以帮助您入门.

这篇关于如何使用Visual Studio代码调试Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆