4

I have a project on GAE wich use Google Cloud Datastore. Of course, I have a development environment on my local machine(with local Datastore), and stage environment and production environment on the Google Cloud with two Datastores(stage & prod) for each environment. When I run a project on my local machine NDB connect me to my local Datastore. And it's a problem because I want to connect to Google Cloud Datastore

How can I run the project on my local machine and connect it Google Cloud Datastore(stage)?

I use Python, and run the project via: dev_appserver.py app.yaml

  • Can you provide us with why you want to remotely connect to Datastore in Google Cloud?Are you sure it's the only way you can accomplish what you're trying to? I could be wrong, but I can't remember anything like that in their documentation and I believe it wasn't meant to be used this way... – Renato Byrro Apr 13 '17 at 21:33
  • For example, I want to make migration for all my data in the Google Cloud Datastore. – Igor Kopanev Apr 14 '17 at 11:35
  • Actually, it looks like there's an [API for remote connection](https://cloud.google.com/appengine/docs/standard/python/tools/remoteapi), but I read it's quite slow. Have you tried these alternatives: [this](http://stackoverflow.com/questions/25530199/how-to-upload-data-in-bulk-to-the-appengine-datastore-older-methods-do-not-work) and [this? – Renato Byrro Apr 14 '17 at 20:53
  • ... and [this](http://stackoverflow.com/questions/30949385/importing-a-large-csv-from-cloud-storage-into-app-engine-datastore)? – Renato Byrro Apr 14 '17 at 20:53
  • Another idea: if your data is originally in SQL, you could [import into Cloud SQL](https://cloud.google.com/sql/docs/mysql/import-export/importing) temporarily and then [migrate to Datastore](http://stackoverflow.com/questions/28484624/migration-from-google-cloud-sql-to-datastore). Please let us know if any of those options solves you problem and how you worked it out... May be useful for someone else in the future. – Renato Byrro Apr 14 '17 at 20:58
  • @RenatoByrro thanks, I guess it will be helpful – Igor Kopanev Apr 18 '17 at 09:45

1 Answers1

-2

You have to specify the path to your codebase. IF you are running the command from the same folder, use .

dev_appserver.py .

Anurag Saxena
  • 388
  • 2
  • 7
  • thanks for the answer. BUT, I want to connect to https://console.cloud.google.com/datastore from my localhost. – Igor Kopanev Apr 13 '17 at 14:37
  • Dont know about that. Hopefully this can help: http://stackoverflow.com/questions/21864925/connecting-to-appengine-datastore-in-development-via-cloud-datastore-api – Anurag Saxena Apr 13 '17 at 15:45