I am trying to download a Django project from github and one of the requirements is:"As the project uses python-decouple you will need to create a file named .env on the root of the project with three values, as following:
DEBUG=True
SECRET_KEY='mys3cr3tk3y'
DATABASE_URL='postgres://u_bootcamp:p4ssw0rd@localhost:5432/bootcamp
"
1.What(where) is the root part of the project, is it part of the project where are settings?
2.What kind of file should .env be?(python package I suppose)
3.Should name of the file be simply .env(or something.env)?
4.Is .env file going to be imported in settings file?
You can create an. env file in the application's root directory that contains key/value pairs defining the project's required environment variables.
In the explorer panel, click on the New File button as shown in the following screenshot: Then simply type in the new file name . env ... Get JavaScript by Example now with the O'Reilly learning platform.
If you have a Unix/Linux/MacOs terminal you navigate to the project root directory and type touch . env which will create a file named . env to hold configuration information.
What(where) is the root part of the project, is it part of the project where are settings?
manage.py
file is (that is your project root directory).What kind of file should .env be? (python package I suppose)
.env
is a text file not a package.Should name of the file be simply .env (or something.env)?
.env
Is .env file going to be imported in settings file?
python-decouple
automatically picks variables from there.Read more about Where the settings data are stored? and Usage of python-decouple
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With