在Webfaction上隐藏安全的Django设置信息 [英] Hiding secure django settings info on webfaction

查看:143
本文介绍了在Webfaction上隐藏安全的Django设置信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在webfaction上隐藏安全信息,例如Django应用程序的数据库密码.
但是我找不到使用环境变量设置这些信息的方式和位置?

I am trying to hide secure info like database password of a django application on webfaction.
But I could not find how and where to set these infos using environmental variables?

推荐答案

将它们添加到您的bash_profile中.

Add them to your bash_profile.

在运行SSH之后:

nano ~/.bash_profile

然后添加所需的变量并保存.示例:

Then add your desired variables and save it. Example:

export DATABASE_URL=postgres://username:password@host:port/databasename

这将使用字符串的内容创建一个名为DATABASE_URL的环境变量.要进行测试,请在终端中运行echo $DATABASE_URL.

This will create an environment variable named DATABASE_URL with the contents of your string. To test, run echo $DATABASE_URL in your terminal.

这篇关于在Webfaction上隐藏安全的Django设置信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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