【发布时间】:2018-02-05 06:48:33
【问题描述】:
我正在运行 Gunicorn/Nginx 的 Ubuntu 16.04 Digital Ocean 服务器上运行我的 Django 项目。我有我的整个项目,除了我的settings.py 文件,所以我现在正在寻找添加它 - 但是不想硬编码SECRET_KEY - 所以我希望定义一个环境变量,就像它在 Django 文档中所说的那样:@987654324 @。
我在哪里定义这个变量?是否在我的 gunicorn 配置文件中 (/etc/systemd/system/gunicorn.service)
【问题讨论】:
-
看看
python-decouplegithub.com/henriquebastos/python-decouple -
你使用的是虚拟环境吗?
-
是的,我的虚拟环境是我根目录中的
env文件夹(与manage.py一起)
标签: python django nginx gunicorn