Run App Engine development server with modules in PyCharm(在 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 开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 PyCharm 中运行带有模块的 App Engine 开发服务器


基础教程推荐
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01