简体   繁体   English

如何从Android应用程序和django网站访问一个Cloud Datastore(Google App Engine)?

[英]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.

相关问题 如何在没有App Engine的情况下在Android中获取Google Cloud Datastore实体? - How to get a Google Cloud Datastore entity in Android without App Engine? 如何使用带有云端点的Google App Engine从Android设备上的数据存储中检索数据? - How to retrieve data from the datastore on Android device, using Google App Engine with Cloud Endpoints? 如何从Android中的Google App Engine数据存储区中获取数据 - how to fetch data from google app engine datastore in android 如何在后端而不是App Engine数据存储区中创建与Google Cloud SQL连接的Android应用程序? - How to create an Android app connected with Google Cloud SQL in the backend instead of the App Engine datastore? GCM还是Google Cloud Datastore或Google App引擎? - GCM or Google Cloud Datastore or Google App engine? 带有Google Cloud Datastore的Android应用 - Android App with Google Cloud Datastore 从谷歌应用引擎数据存储区获取数据到Android应用程序 - Getting data to Android app from google app engine datastore 如何通过Google Cloud Endpoints将两个Android应用连接到同一App Engine数据存储区? - How to connect two Android apps through to the same App Engine Datastore through Google Cloud Endpoints? 带有Cloud SQL或数据存储的Android App Engine - Android App Engine with Cloud SQL or Datastore 如何使用谷歌应用程序引擎从数据存储区检索信息,并使用Java在Android应用程序的列表视图中显示它? - how to retrieve info from datastore using google app engine and display it in a list view on an android app using java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM