如何使用vscode创建django项目


当前第2页 返回上一页

在launch.json设置如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

{

    // 使用 IntelliSense 了解相关属性。

    // 悬停以查看现有属性的描述。

    "version": "0.2.0",   

"configurations": [{           

        "name": "Python: Current File (Integrated Terminal)",           

        "type": "python",           

        "request": "launch",           

        "program": "${file}",     

         "console": "integratedTerminal"

        },

        {           

         "name": "Python: Attach",           

         "type": "python",           

         "request": "attach",           

         "port": 5678,           

         "host": "localhost"

        },

        {           

         "name": "Python: Module",           

         "type": "python",           

         "request": "launch",           

         "module": "enter-your-module-name-here",           

         "console": "integratedTerminal"

        },

        {           

         "name": "Python: Django",           

         "type": "python",           

         "request": "launch",           

         "program": "${workspaceFolder}/HelloWorld/manage.py",           

         "console": "integratedTerminal",           

         "args": [               

         "runserver",               

         "8080", //配置Django端口               

         "--noreload",               

         "--nothreading"

            ],           

         "django": true

        },

        {           

         "name": "Python: Flask",           

         "type": "python",           

         "request": "launch",           

         "module": "flask",           

         "env": {               

         "FLASK_APP": "app.py"

            },           

         "args": [               

         "run",               

         "--no-debugger",               

         "--no-reload"

            ],           

         "jinja": true

        },

        {           

         "name": "Python: Current File (External Terminal)",           

         "type": "python",           

         "request": "launch",           

         "program": "${file}",           

         "console": "externalTerminal"

        }

    ]

}

五、浏览器查看效果

ade0800a06324ea0e9ed8d1e990c425.png

2e6293ec52632689bb22a4c6578daa1.png

相关文章教程推荐:vscode教程

以上就是如何使用vscode创建django项目的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

vsCode 和 visual studio 区别

vsCode怎么设置编译less

vsCode设置不了中文

怎样更改vsCode的代码编辑环境背景

vsCode的格式化代码快捷键是什么

如何使用vsCode将项目上传到github

vsCode可以开发什么

如何打开vsCode中的用户自定义配置

vsCode中docker怎么安装

vsCode不能编辑文件怎么办

更多相关阅读请进入《vsCode》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...