简体   繁体   English

本地主机运行时如何解锁应用引擎数据库?

[英]How do I unlock the app engine database when localhost runs?

Right now I get a blank page when localhost runs, but the deployed app is fine.现在我在 localhost 运行时得到一个空白页面,但部署的应用程序很好。 The logs show the "database is locked".日志显示“数据库已锁定”。 How do I "unlock" the database for localhost?如何“解锁”本地主机的数据库?

This can happen if you're running multiple instances of dev_appserver without giving them distinct datastore files/directories.如果您正在运行 dev_appserver 的多个实例而没有为它们提供不同的数据存储文件/目录,则可能会发生这种情况。 If you need to be running multiple instances, see dev_appserver.py --help and look at the options for specifying paths/files.如果您需要运行多个实例,请参阅dev_appserver.py --help并查看用于指定路径/​​文件的选项。

Dave W. Smith has the right idea. Dave W. Smith 的想法是正确的。 I had this same issue and looking into the docs you need to set the --storage_path='some/path' to be different for each instance of the localhost.我遇到了同样的问题,并查看了您需要将--storage_path='some/path'设置为每个本地主机实例不同的文档。

From the Docs:从文档:

 --storage_path PATH      path to the data (datastore, blobstore, etc.)

Also, different port and admin_ports have to be set to run the two instances.此外,必须设置不同的 port 和admin_ports才能运行这两个实例。

I tried this and it worked, I noticed that when this happens, there are multiple pythonw.exe processes working in the process bar.我试过了,它奏效了,我注意到当发生这种情况时,进程栏中有多个 pythonw.exe 进程在工作。

Go to command prompt, run the following转到命令提示符,运行以下命令

taskkill /f /im pythonw.exe 

Restart your application from the app launcher从应用程序启动器重新启动您的应用程序

So with your command to start the server which should be start_in_shell.sh -f -p 8xxx -a 8xxx所以用你的命令启动服务器,它应该是start_in_shell.sh -f -p 8xxx -a 8xxx

do include a -s flag after the -f as below:-f之后包含一个-s标志,如下所示:

start_in_shell.sh -f -s -p 8xxx -a 8xxx

Sometimes some unanticipated error somewhere causes this issue.有时某个地方的一些意外错误会导致此问题。 Remember to keep only one of the instances with this flag( -s ) and others should be started as you do usually.记住保留一个带有此标志( -s )的实例,其他实例应该像往常一样启动。

This should make it work.这应该使它工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当服务器绑定到特定IP(不是localhost)时,如何使Google App Engine python SDK Remote API与本地开发服务器一起使用? - How do I make Google App Engine python SDK Remote API work with local development server when server is bound to specific IP (not localhost)? 导出应用引擎数据时如何排除列 - How do I exclude columns when exporting app engine data 本地主机上的Google App Engine数据库访问 - Google app engine database access on localhost 如何“重置”在使用 Flask 应用程序数据库的 Python 脚本中运行的 db.session? - How do I "reset" the db.session that runs in a Python script that uses a database from a Flask App? 如何让Google App Engine具有下载链接,该链接可从数据库中下载内容? - How do I let Google App Engine have a download link that downloads something from a database? 字段名称未知时如何将文件上传到Google App Engine应用程序 - How do I upload a files to google app engine app when field name is not known 使用App Engine SDK在localhost中部署我的Google端点python应用程序时出错 - Error when I am deploying my google cloud endpoints python application in localhost with App Engine SDK 在尝试将Facebook好友加载到Google App Engine facebook示例时,如何解析JSON数组? - How do I parse the JSON array when trying to load facebook friends into Google App Engine facebook example? 我什么时候需要Google App Engine数据存储区的索引? - When do I need index for Google App Engine Datastore? 如何从Google App Engine应用程序解析XML? - How do I parse XML from a Google App Engine app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM