简体   繁体   English

单个Google App Engine项目中的Java和Python

[英]Java and Python Together in Single Google App Engine Project

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). 我目前有一个在Google App Engine上运行的Java应用程序,但我想添加Python模块的SearchableModel提供的功能(当然,对于搜索功能)。 Is it possible to run python code in the same project as Java code, just under a different version? 是否可以在与Java代码相同的项目中运行python代码,只是在不同的版本下? 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. 如果没有,它们可能是针对单个数据存储区运行的两个独立应用程序(当前Java应用程序和基于Python的新搜索应用程序),但我认为这不可能。

It is possible to run Python and Java applications on different versions. 可以在不同版本上运行Python和Java应用程序。

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. 最后但同样重要的是:请记住,您可以拥有不同版本的应用程序(使用相同的数据存储区),其中一些是使用Python运行时实现的,有些是使用Java运行时,并且您可以访问与“default / active”不同的版本“一个有明确的URL。

Yes, you can write your app in Java and also have a separate version of your app running Python. 是的,您可以用Java编写应用程序,并且还有一个运行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. 但是,如果您的应用程序的核心已经用Java实现,那么您可能希望查看SearchableModel Python 代码 ,然后考虑实现一些东西以实现您在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. 您还应该查看App Engine上构建可扩展的复杂应用程序视频。 Depending on your use-case, moving the search-word list to an 'Index Relation Entity' might offer further improvements. 根据您的使用情况,将搜索词列表移动到“索引关系实体”可能会提供进一步的改进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM