1

Hey guys kind of a n00b in App engine and I have been strugling with this is there a way that I can add/bulk default data to Data Store.

I would like to create catalogs or example data, as well user or permission. I am not using the default App engine user instead I am using webapp2 User auth session base model.

Thanks

Necronet
  • 6,704
  • 9
  • 49
  • 89

2 Answers2

1

You can use the bulkloader: https://developers.google.com/appengine/docs/python/tools/uploadingdata Or upload data to the blobstore and move it to the datastore.

voscausa
  • 11,253
  • 2
  • 39
  • 67
  • I'am not aware that you can upload data with the bulkloader to the local store. But with the remote API you can use the datastore data in your SDK: https://developers.google.com/appengine/articles/remote_api – voscausa Sep 26 '12 at 09:02
1

This is a large topic but, I am using Java code running in task queues to do this.

  1. Much easier to create random test and demo data through code.
  2. Much more friendly to unit testing.
  3. This requires no dependencies. It is just code running and accessing the datastore.
  4. Sometimes easier to manipulate the datastore through code instead of scripts when logic is involved in the changes.
  5. Allows us to upload new task definitions (a Java classes) embedded in a new app version. Then, we trigger the tasks executions by calling a servlet URL. These task classes are then removed from the next app version.
  6. And using tasks, you get around the request execution timeout. If a task is long running, we split it as sequential tasks. When a task completes, it queues the next one automatically.

Of course, this requires a fair amount of coding but is really simple and flexible at the same time.

Starman
  • 426
  • 3
  • 6