我正在尝试从github下载一个Django项目,其中一个要求是:“由于该项目使用python-decouple,因此您需要在项目根目录下创建一个名为.env的文件,其中包含三个值,如下所示:
DEBUG=True
SECRET_KEY='mys3cr3tk3y'
DATABASE_URL='postgres://u_bootcamp:p4ssw0rd@localhost:5432/bootcamp“
1.项目的根部分是什么?它是项目的一部分吗?设置在哪里?
2. .env应该是什么样的文件?(我想是python包)
3.文件名应该是简单的.env(或something.env)吗?
4.是否要在设置文件中导入.env文件?
发布于 2017-04-15 01:21:20
- Where your `manage.py` file is (that is your project root directory).
- `.env` is a text file not a package.
文件的名称应仅为something.env)? (或
- Just `.env`
- No need to import, `python-decouple` automatically picks variables from there.
阅读更多关于Where the settings data are stored?和python-decouple的Usage的信息。
https://stackoverflow.com/questions/43416029
复制相似问题