Java 和 Python 一起出现在单个 Google App Engine 项目中

发布于 2024-10-08 09:29:27 字数 216 浏览 0 评论 0原文

我目前有一个在 Google App Engine 上运行的 Java 应用程序,但我想添加 Python 模块的 SearchableModel 提供的功能(当然是搜索功能)。是否可以在与 Java 代码相同的项目中运行 python 代码,只是在不同的版本下?如果不是,它们可能是针对单个数据存储运行的两个单独的应用程序(当前的 Java 应用程序和新的基于 Python 的搜索应用程序),但我认为这是不可能的。

I currently have a Java application running on Google App Engine, but I want to add the features that the Python module's SearchableModel provides (for search features of course). Is it possible to run python code in the same project as Java code, just under a different version? If not, could they be two separate apps (current Java app and a new Python-based search app) running against a single datastore, but I don't think that is possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心如荒岛 2024-10-15 09:29:27

可以在不同版本上运行 Python 和 Java 应用程序。

来自

最后但并非最不重要的一点:请记住,您可以拥有不同版本的应用程序(使用相同的数据存储),其中一些是使用 Python 运行时实现的,一些是使用 Java 运行时实现的,并且您可以访问与“默认/活动”具有明确 URL 的一种。

It is possible to run Python and Java applications on different versions.

From:

Last but not least: remember that you can have different version of your app (using the same datastore) some of which are implemented with the Python runtime, some with the Java runtime, and you can access versions that differ from the "default/active" one with explicit URLs.

终止放荡 2024-10-15 09:29:27

是的,您可以使用 Java 编写应用程序,也可以使用运行 Python 的单独版本的应用程序。

但是,如果您的应用程序的核心已使用 Java 实现,您可能需要查看 SearchableModel Python 代码,然后考虑使用 Java 实现某些内容来实现您的目标。要点是,您可以简单地构建搜索词列表并将其存储在 多值属性(即列表)。

您还应该查看在 App Engine 上构建可扩展的复杂应用 视频。根据您的用例,将搜索词列表移动到“索引关系实体”可能会提供进一步的改进。

Yes, you can write your app in Java and also have a separate version of your app running Python.

However, if the core of your app is already implemented in Java, you might want to look at the SearchableModel Python code, then consider implementing something to accomplish your goal in Java. The gist is that you could simply build your list of search-words and store them in a multivalued property (ie a list).

You should also check out the Building Scalable, Complex Apps on App Engine video. Depending on your use-case, moving the search-word list to an 'Index Relation Entity' might offer further improvements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文