Visual Studio 中的 运行 按钮提供 manage.py 选项而不是 运行
Run button in Visual Studio gives options for manage.py instead of running
我正在尝试 运行 一个以 manage.py 作为启动文件的 Django 项目。我可以 运行 在命令提示符下使用 python manage.py runserver
并手动导航到该站点。我期望当我在 Visual Studio 中按下 运行 按钮时,它会启动服务器并打开我的浏览器以显示该页面,但它只是打开 manage.py 的选项:
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
[auth]
changepassword
createsuperuser
等等
我已经尝试将 manage.py 重新设置为启动文件,重新设置启动项目,并将 Python Tools Interactive Windows 的启动脚本设置为 manage.py.
在此先感谢您的帮助。
原来我没有为调试设置启动模式。我进入了 Project-> 'Project-name' Properties... -> Debug tab
。我看到我没有从下拉菜单中选择 Launch mode
。我选择了 Web launcher
,现在一切都如我所料。
我正在尝试 运行 一个以 manage.py 作为启动文件的 Django 项目。我可以 运行 在命令提示符下使用 python manage.py runserver
并手动导航到该站点。我期望当我在 Visual Studio 中按下 运行 按钮时,它会启动服务器并打开我的浏览器以显示该页面,但它只是打开 manage.py 的选项:
Type 'manage.py help <subcommand>' for help on a specific subcommand.
Available subcommands:
[auth]
changepassword
createsuperuser
等等
我已经尝试将 manage.py 重新设置为启动文件,重新设置启动项目,并将 Python Tools Interactive Windows 的启动脚本设置为 manage.py.
在此先感谢您的帮助。
原来我没有为调试设置启动模式。我进入了 Project-> 'Project-name' Properties... -> Debug tab
。我看到我没有从下拉菜单中选择 Launch mode
。我选择了 Web launcher
,现在一切都如我所料。