[英]How to access one Cloud Datastore(Google App Engine) from Android app and django-website?
so I created App Engine Connected Android Project, I successfully deployed it to app engine server and I`m able to upload and retrieve my entities from my android app. 因此我创建了App Engine Connected Android项目,成功将其部署到App Engine服务器,并且能够从Android应用程序上载和检索实体。
Now I want to create a website, which should access same entities and most preferably I want to code it in python-django. 现在,我想创建一个网站,该网站应该访问相同的实体,最理想的是,我想用python-django对其进行编码。 Is it possible? 可能吗? Or create django website and then somehow add android access endpoints? 还是创建Django网站,然后以某种方式添加android访问端点? I couldn`t google anyhing useful. 我无法用Google搜索任何有用的信息。
I m stuck here and will be really really thankfull. This is my first app engine app so I hope I
我m stuck here and will be really really thankfull. This is my first app engine app so I hope I
m stuck here and will be really really thankfull. This is my first app engine app so I hope I
m not asking stupid question. m stuck here and will be really really thankfull. This is my first app engine app so I hope I
不要问愚蠢的问题。
If I understand correct, you already have deployed your core functionality on the server side via Cloud endpoints and are able to access that functionality from your Android client. 如果我理解正确,那么您已经通过Cloud端点在服务器端部署了核心功能,并且能够从您的Android客户端访问该功能。
You can definitely access the same functionality via a web application (this could be the same App Engine application in which you have hosted the cloud endpoints) or it could be another web application also. 您绝对可以通过Web应用程序(可以是托管云端点的同一App Engine应用程序)访问相同的功能,也可以是另一个Web应用程序。 The Endpoints can be accessed via a JavaScript client API that Google provides. 可以通过Google提供的JavaScript客户端API访问端点。 Take a look at the following API : https://developers.google.com/api-client-library/javascript/ and the documentation for accessing endpoints via JavaScript : https://developers.google.com/appengine/docs/python/endpoints/consume_js 查看以下API: https : //developers.google.com/api-client-library/javascript/和用于通过JavaScript访问端点的文档: https : //developers.google.com/appengine/docs/python /端点/ consume_js
The projected you created using the wizard using Java on both Android and GAE. 您在Android和GAE上使用Java使用向导创建的项目。 You could add a web client to that as described in @Romin's answer, but you can also use Django. 您可以按照@Romin的答案中所述将Web客户端添加到该客户端,但也可以使用Django。
I think the best way to do this is to scrap the Java server that the wizard generated and replace with a Django/Python runtime. 我认为做到这一点的最佳方法是废弃该向导生成的Java服务器,并用Django / Python运行时替换。 As you suggested, you can then use Cloud Endpoints to generated Android client code from your Python code. 如您所建议,然后可以使用Cloud Endpoints从Python代码生成Android客户端代码。
It is possible to stick with the generated Java Server and use Django but I think that adds unncessary complexity. 可以坚持使用生成的Java Server并使用Django,但我认为这增加了不必要的复杂性。 YOu would need to either communicate between the Python and Java applications, or use the new modules feature to have 2 different runtimes in one app, but this will probably result in greater cost and it would be a cutting edge use of a new feature. 您可能需要在Python和Java应用程序之间进行通信,或者使用新的模块功能在一个应用程序中具有2个不同的运行时,但这可能会导致更高的成本,并且这将是对新功能的尖端使用。 I"ve looked at the Java modules docs and don't see how one would add a Python runtime to complement your existing Java runtime, but apparently it is possible: 我看过Java模块文档,但看不到如何添加Python运行时来补充现有Java运行时,但是显然有可能:
https://groups.google.com/forum/#!msg/google-appengine/1228g7-qXZY/_ubjgHlE2_wJ https://groups.google.com/forum/#!msg/google-appengine/1228g7-qXZY/_ubjgHlE2_wJ
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.