无法在Eclipse中作为“PyDev:Django”运行

时间:2021-05-02 19:18:36

When creating a new Django project in Eclipse I can run the server by running the project as "PyDev: Django" like in the following screenshot:

在Eclipse中创建一个新的Django项目时,我可以通过运行项目“PyDev:Django”来运行服务器,如下面的屏幕截图所示:

无法在Eclipse中作为“PyDev:Django”运行

I've recently forked a Django project from GitHub, added it to Eclipse and set it as a Django project. The problem is that I don't have the option to run the project as "PyDev: Django" when trying to do so in Eclipse:

我最近从GitHub分叉了一个Django项目,将它添加到Eclipse并将其设置为Django项目。问题是当我在Eclipse中尝试这样做时,我没有选择以“PyDev:Django”的形式运行项目:

无法在Eclipse中作为“PyDev:Django”运行

How can I fix this?

我怎样才能解决这个问题?

1 个解决方案

#1


4  

I had the same issue after importing an existing project in Eclipse.

在Eclipse中导入现有项目后,我遇到了同样的问题。

Here is how I solved it:

这是我解决它的方式:

  • set your directory to Django project using "PyDev" -> "set as Django project"
  • 使用“PyDev” - >“设置为Django项目”将目录设置为Django项目

  • use the same "PyDev" menu and set it "as a PyDev project".
  • 使用相同的“PyDev”菜单并将其设置为“PyDev项目”。

The last command will configure the pydev nature of the project. You should now have the "PyDev: Django" and "Python unit-test" options to the "Run as" menu.

最后一个命令将配置项目的pydev性质。您现在应该在“运行方式”菜单中使用“PyDev:Django”和“Python单元测试”选项。

#1


4  

I had the same issue after importing an existing project in Eclipse.

在Eclipse中导入现有项目后,我遇到了同样的问题。

Here is how I solved it:

这是我解决它的方式:

  • set your directory to Django project using "PyDev" -> "set as Django project"
  • 使用“PyDev” - >“设置为Django项目”将目录设置为Django项目

  • use the same "PyDev" menu and set it "as a PyDev project".
  • 使用相同的“PyDev”菜单并将其设置为“PyDev项目”。

The last command will configure the pydev nature of the project. You should now have the "PyDev: Django" and "Python unit-test" options to the "Run as" menu.

最后一个命令将配置项目的pydev性质。您现在应该在“运行方式”菜单中使用“PyDev:Django”和“Python单元测试”选项。