Matúš Bartko
Matúš Bartko

Reputation: 2457

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.

Now I want to create a website, which should access same entities and most preferably I want to code it in python-django. Is it possible? Or create django website and then somehow add android access endpoints? I couldn`t google anyhing useful.

Im stuck here and will be really really thankfull. This is my first app engine app so I hope Im not asking stupid question.

Upvotes: 1

Views: 460

Answers (2)

Tom
Tom

Reputation: 17892

The projected you created using the wizard using Java on both Android and GAE. You could add a web client to that as described in @Romin's answer, but you can also use 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. As you suggested, you can then use Cloud Endpoints to generated Android client code from your Python code.

It is possible to stick with the generated Java Server and use Django but I think that adds unncessary complexity. 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. 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:
https://groups.google.com/forum/#!msg/google-appengine/1228g7-qXZY/_ubjgHlE2_wJ

Upvotes: 1

Romin
Romin

Reputation: 8816

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.

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. The Endpoints can be accessed via a JavaScript client API that Google provides. 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

Upvotes: 1

Related Questions