gpt4 book ai didi

python - App Engine gcloud : Can't find Python files in Home directory, 但它们已经上线?

转载 作者:行者123 更新时间:2023-12-01 01:43:54 25 4
gpt4 key购买 nike

几个月前,我在 Google App Engine 中做了一个测试项目,然后转向其他项目,但现在想再做一次,所以我登录到我的 Google Cloud 帐户并启动编辑器开始调整我的 .py 文件的样式。

当我在桌面上和 Google Cloud 中打开 Google Cloud 编辑器时,我可以打开该项目,但主目录只有 1 个 index.yaml(与项目无关的内容)文件和一个 README。我尝试搜索 main.py,但没有结果。如果我导航到我的project.appspot.com url,该项目就会像我从未离开过一样运行。另外,如果我转到“服务”并选择“诊断>>源”,我可以看到我正在查找的所有文件的代码。

我听说 Cloud SDK 的作用就像它自己的带有驱动器空间的计算机,所以我基本上是在问:如何导航到 Google 云编辑器中的实时项目目录以便我可以继续编辑?

再次感谢您的帮助!

Cloud SDK Doesn't show my files?

Files Show fine in the debugger?

最佳答案

您的 Cloud shell 主目录可能已因不活动而被删除。来自 Usage limits :

If you do not access Cloud Shell for 120 days, we will delete your home disk. You will receive an email notification before we do so and simply starting a session will prevent its removal. Please consider a different solution on Google Cloud Storage for sensitive data you wish to store long term.

除非您永久禁用应用程序代码下载,否则您可以使用 GAE SDK(也可在您的云 shell 中使用)将部署的(仅限标准环境)应用程序代码下载回新的云 shell 主目录 - 请参阅 Downloading Your Source Code详情:

You can download an application's source code by running the appcfg.py command with the download_app action. The appcfg.py
download_app
command is available through the original App Engine SDK for Python.

appcfg.py -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]

或者从 StackDriver 复制粘贴文件(乏味)

如果您使用灵活的环境,请查看此答案:Downloading App Engine source code .

但是更好的想法是将您的代码管理在某个远程存储库中,可以从您的 clod shell 计算机访问,以便您可以随时恢复任何版本。也许Google Cloud Source Repositories ,与各种 GCP 产品集成。

关于python - App Engine gcloud : Can't find Python files in Home directory, 但它们已经上线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51599242/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com