在GAE控制面板中设置环境变量 [英] Set environment variables in GAE control panel

查看:128
本文介绍了在GAE控制面板中设置环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Github将我的项目部署到GAE。有一些外部的API密钥我不想保存在存储库中并公开。是否可以在GAE控制面板中为项目设置一个环境变量,以便我可以在应用程序中捕获它?

解决方案

您可以在App Engine应用程序的配置文件中定义环境变量。在Python的情况下,它是 app.yaml

  env_variables:
MY_ENV_VAR:'some_value'

您可以找到更多详情 here

没有这样的目前可以在Developers Console中定义的项目参数。


I deploy my project to GAE over Github. There is some foreign API-key which I don't want to save in repository and make them public. Is it possible to set an environment variable for a project in GAE control panel so I can catch it in my application?

解决方案

You can define environment variables in configuration file for App Engine application. In case of Python, it is app.yaml

env_variables:
   MY_ENV_VAR: 'some_value'

You can find more details here.

There is no such a thing like project parameters that can be defined in Developers Console at the moment.

这篇关于在GAE控制面板中设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆