python - 如何在 Eclipse/Python/Appengine 中使用持久本地 NDB 数据进行调试?

标签 python eclipse google-app-engine

我正在使用 Eclipse/Pydev 为 AppEngine 开发一个 Python 应用程序,并且需要使用存储在本地 NDB 中的持久数据进行调试。

现在,我的 Linux 计算机上 NDB 的默认路径是/tmp,每次重新启动后都会被丢弃。我找不到告诉 Eclipse 使用 NDB 自定义路径的方法,所以我最终通过终端启动 dev_appserver.py:

dev_appserver.py --datastore_path=/home/myfolder/workspace/myapp_datastore app.yaml

现在,当我启动调试器时,我确实需要持久数据来跟踪一些棘手的错误,但正如前面提到的,我找不到一种方法来告诉 Eclipse 在哪里存储本地 NDB,因此我无法使用具有持久数据的调试器。

有人知道解决办法吗?

谢谢!

最佳答案

注意:我是 PyCharm,不是 Eclipse 用户,答案基于我看到的信息。

带有Arguments选项卡的Run Configuration窗口允许您为dev_appserver.py配置可选参数(相当旧的) Cant Run Google appengine python app on eclipse although launcher works fine ,但在 4.4. Run your application 中得到确认:

You still can use the command line to run your GAE application. But we are now going to configure Eclipse to allow you to run your application directly from Eclipse. Right-click on "todo.py", select Run As ▸ Run Configuration. Under Main Module maintain the path to dev_appserver.py.

enter image description here

Switch to the argument tab and maintain the full path name of your project as a parameter. Put the parameter in double-quotes.

enter image description here

我同意,这些是运行配置,您正在询问用于调试应用程序的配置。好吧,至少在 PyCharm 中,它们也适用于通过调试器运行,它们实际上称为运行/调试配置

也许这也适用于 Eclipse,所以恕我直言,值得在您的 Eclipse 版本中找到此选项卡并在其中配置您想要的参数,然后检查它们是否适用于调试器。

关于python - 如何在 Eclipse/Python/Appengine 中使用持久本地 NDB 数据进行调试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46719033/

相关文章:

python - 使用 instapy-cli 库通过 try/except 防止 python 脚本崩溃

python - 检索 Oracle DB 12c 中最近插入的标识

python - 替换 R 中段落中的确切句子

Eclipse 在 View 中显示浏览器

php - 使用 PHP 连接到 App Engine 中的本地 MySQL

python - 缓存 get_serving_url() URL

Python绘制极坐标方程

eclipse - 在 eclipse 中创建 java/c++ 项目

java - 如何在运行配置中容纳从 Eclipse 到 IntelliJ 的类路径用户条目

java - App Engine Cloud Endpoints Frameworks (Java) - 在本地运行时出现 NullPointerException