Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating .env file on the root of the project

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?

like image 566
esnaf96 Avatar asked Apr 14 '17 17:04

esnaf96


People also ask

Where should I create .env 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.

How do I create an .env file?

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.

How do I create an env file in Terminal?

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.


1 Answers

  1. What(where) is the root part of the project, is it part of the project where are settings?

    • Where your manage.py file is (that is your project root directory).
  2. What kind of file should .env be? (python package I suppose)

    • .env is a text file not a package.
  3. Should name of the file be simply .env (or something.env)?

    • Just .env
  4. Is .env file going to be imported in settings file?

    • No need to import, python-decouple automatically picks variables from there.

Read more about Where the settings data are stored? and Usage of python-decouple.

like image 71
Aamir Rind Avatar answered Oct 11 '22 09:10

Aamir Rind