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

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

问题描述

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

  dev_appserver.py app.yaml othermodule .yaml 

当我添加 app.yaml othermodule.yaml


<$ p $>到PyCharm的Run / Debug配置中的Additional options,然后运行开发服务器,我收到以下错误消息: p> google.appengine.tools.devappserver2.errors.InvalidAppConfigError:。
是一个目录,需要一个yaml配置文件

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

  dev_appserver.py app.yaml othermodule.yaml。 

是否可以删除点,还是必须等到PyCharm中修复这个点?

解决方案

您可以通过创建一个新的运行配置。
选择Python配置,然后填写如下:
$ b


  • 脚本: / path / to / your / dev_appserver.py

  • 脚本参数: dispatch.yaml module1.yaml module2.yaml

  • 工作目录: / path / to / your / appengine / project



它对我来说就像这样很好。调度员正在启动,我已经像PyCharm一样获得了所有日志。


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

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: "." is a directory and a yaml configuration file is required

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 .

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.

解决方案

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

  • script: /path/to/your/dev_appserver.py
  • script parameters: dispatch.yaml module1.yaml module2.yaml
  • working directory: /path/to/your/appengine/project

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天全站免登陆