How to I hide my secret_key using virtualenv and Django?

后端 未结 4 1721
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 08:12

I am using Django, python, virtualenv, virtualenvwrapper and Vagrant.

So far I h

4条回答
  •  长情又很酷
    2020-12-29 08:52

    Common approach, if you'd like to configure region, but did not want to store sensitive information in repo, is to pass it through environment variables. When you need it just call os.environ('SECRET') (even in your settings.py). Better with some fallback value.

    Virtualenv does not helps you to hide anything, it just prevent you system-wide Python installation from littering by one-project-required-packages.

提交回复
热议问题