在 PyCharm 中运行带有模块的 App Engine 开发服务器 [英] Run App Engine development server with modules in PyCharm

查看:28
本文介绍了在 PyCharm 中运行带有模块的 App Engine 开发服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自最新版本的 Google App Engine Python SDK 以来,可以使用 模块.我有一个带有默认模块和另一个模块的 Python 应用程序.要在开发服务器中启动模块,开发服务器必须像这样运行:

Since the latest release of the Google App Engine Python SDK, it's possible to use modules. I have a Python application with a default module and another module. To start the module in the development server, the development server has to be run like this:

dev_appserver.py app.yaml othermodule.yaml

当我将 app.yaml othermodule.yaml 添加到 PyCharm 的运行/调试配置中的附加选项"中,然后运行开发服务器时,我收到以下错误消息:

When I add app.yaml othermodule.yaml to "Additional options" in the Run/Debug configuration of PyCharm and then run the development server, I get the following error message:

google.appengine.tools.devappserver2.errors.InvalidAppConfigError:."是目录,需要yaml配置文件

google.appengine.tools.devappserver2.errors.InvalidAppConfigError: "." is a directory and a yaml configuration file is required

这是因为 PyCharm 在命令末尾添加了一个点来运行开发服务器,如下所示:

This is because PyCharm adds a dot at the end of the command to run the development server, like this:

dev_appserver.py app.yaml othermodule.yaml .

是否可以删除该点,还是我必须等到 PyCharm 修复此问题?在有模块之前,没有必要这样做.

Is it possible to remove the dot, or do I have to wait until this is fixed in PyCharm? Before there were modules, there was no need for this.

推荐答案

您暂时可以通过创建一个新的运行配置来解决这个问题.选择 Python 配置,然后填写如下:

You can go around this for the time being by just creating a new Run Configuration. Chose Python configuration, then fill like this:

  • 脚本:/path/to/your/dev_appserver.py
  • 脚本参数:dispatch.yaml module1.yaml module2.yaml
  • 工作目录:/path/to/your/appengine/project

它对我来说就像这样工作得很好.调度程序正在正常启动,并且我在 PyCharm 中获得了与以前一样的所有日志.

It works just fine like this for me. The dispatcher is launching properly and I've got all the logs like before in PyCharm.

这篇关于在 PyCharm 中运行带有模块的 App Engine 开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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