I've been using dev_appserver for years for local Python 2.7 development. The datastore is created locally and just works as expected. I'm now migrating to Cloud Datastore and the default behavior appears to be that it accesses my production datastore. Not at all what I expected, and I cannot get dev_appserver to look locally rather than to my cloud data.
The docs: https://cloud.google.com/datastore/docs/tools/datastore-emulator
... tell me to set my env vars as follows:
DATASTORE_DATASET=<my dataset>
DATASTORE_PROJECT_ID=<my project id>
DATASTORE_EMULATOR_HOST_PATH=localhost:8081/datastore
DATASTORE_HOST=http://localhost:8081
DATASTORE_EMULATOR_HOST=localhost:8081
I'm invoking dev_appserver as follows:
python3 /home/ml/google-cloud-sdk/bin/dev_appserver.py \
~/appengine/apps/$1 \
--host=dev6 \
--enable_host_checking=false \
--port=8082 \
--admin_host=dev6 \
--admin_port=8002 \
--application=<my app> \
--support_datastore_emulator=true \
--enable_sendmail \
--smtp_host=dev6 \
--smtp_port=10025 \
--api_port=37063
... and I've tried this also without '--support_datastore_emulator=true'.
... yet my app is still accessing my production datastore.
Can anyone tell me how this is supposed to be configured in order to use a local datastore?