问题
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
回答1:
I think it depends on if you got Java or Python SDK.
For Python, here's what the instructions say from Google: "The web server prints the location of the datastore file it is using to the terminal when it starts up. You can make a copy of the file, then restore them later to reset the datastore to a known state. Be sure to restart the web server after replacing the datastore file.
To change the location used for the datastore file, use the --datastore_path option:
dev_appserver.py --datastore_path=/tmp/myapp_datastore myapp
more info here: http://code.google.com/appengine/docs/python/tools/devserver.html
回答2:
I'm using Windows 7 with the Python SDK. My local datastore is located at
C:\Users\[username]\AppData\Local\Temp\dev_appserver.datastore
回答3:
To find the file location for the local AppEngine datastore on MacOSX/Python, you can run the following command:
dev_appserver.py -help
Mine was at something like:
/var/folders/uP/uP1GHkGKGqO7QPq+eGMmb++++TI/-Tmp-/dev_appserver.datastore
回答4:
I think a lot of the answers on this page are out of date. Under the current Python dev kit (1.8.6) on Windows 7 I eventually found the datastore at:
c:\Users\[username]\AppData\Local\Temp\appengine.[appname]\datastore.db
I couldn't find this info in anything dev_appserver.py
printed out, either with normal startup options or with --help
. On other OSes you might try searching for a file called datastore.db
.
回答5:
For Python u can make access to datastore admin interface path:' /_ah/' or
add the app handler to app.yaml
- url: /admin/.*
script: $PYTHON_LIB/google/appengine/ext/admin
login: admin
and access it at /admin/
回答6:
I use OS X Mavericks (10.9), Python 2.7.5, and Google App Engine SDK 1.9.3 (Python).
None of the above worked for me, however, referencing @alsmola's answer, I executed sudo find / | grep datastore.db
and found the file in /private/var/folders/vw/7w1zhkls4gb1wd8r160c36300000gn/T/appengine.YYYY.XXXXX/datastore.db
(YYYY
is the project name, XXXXX
is my username).
回答7:
Since it's top question on Google search and I spent quite amount of time searching for an answer I'll say that on Windows/Java mix DB file called local_db.bin
.
回答8:
With Maven the files are sitting here:
target/{buildName}/WEB-INF/appengine-generated/
回答9:
I'll restate a solution to getting permanent datastore as it worked for me (circa Feb 2017), running GoogleAppEngineLauncher on OS X v10.10.
- Create the folder path for permanent datastore
- In GAEL, click on the project in question e.g. PROJECTNAME
- Click Edit-Application Settings
in Extra Flags field:
--datastore_path=/Users/foo/GAE_datastore/PROJECTNAME/datastore.db
Filename has to be included; in my config, datastore.db works.
Having searched all over for GAE datastore path, and head-bonked on dev_appserver.py --datastore_path command line, it was very helpful to find this.
Application Settings under the Edit menu is an odd choice, Google :-)
回答10:
The default location of the datastore for the platform you're running the app engine on is provided in the README that comes with the platform (at least, in the one for Linux). The README is in google_appengine_x.x.xx/google_appengine/README
. This is what is says in the Linux'es one:
--datastore_path=DS_FILE Path to file to use for storing Datastore file stub data. (Default /tmp/dev_appserver.datastore)
来源:https://stackoverflow.com/questions/3588817/where-is-my-local-app-engine-datastore