---
title: "Comment by Sandeep on \"How To Use a .env File With Python\" | Hashnode"
description: "Why do we need to write the variable in uppercase in .env file? Is it required?"
url: "https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b"
---

[Discussion](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74)

Comment [How To Use a .env File With Python](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74)

[Sandeep](https://hashnode.com/@sandeepx21)

[Dec 9, 2021](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b)

Why do we need to write the variable in uppercase in .env file? Is it required?

[Louëlla Creemers](https://hashnode.com/@lovelacecoding)

[Dec 9, 2021](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b#reply-61b24b116a81cf6b31dfce48)

No, it's a naming convention.

Keep in mind (if you want to do it differently) that Windows is case-insensitive with global variables. Linux and Mac OS are not. Meaning that if you have a variable called 'Language' and you use os.environ\['language'\], it will work if you run it on Windows but not on MacOS or Linux

[Sandeep](https://hashnode.com/@sandeepx21)

[Dec 10, 2021](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b#reply-61b2e1e79dcafd6aeede344b)

[Lou](https://hashnode.com/@lovelacecoding) Sorry, I don't understand!

Isn't all this is being done by python? why operating system is deciding this behaviour?

(I think it should be case-sensitive because python is a case-sensitive programming language)

[Louëlla Creemers](https://hashnode.com/@lovelacecoding)

[Dec 10, 2021](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b#reply-61b3a9103e16b66b1b1e5761)

[Sandeep](https://hashnode.com/@sandeepx21)

You're right about python being case-sensitive.

But these are environment variables, not Python variables. What makes environment variables so easy to work with is that the variables you create in your .env file are saved onto your local OS. When you use os.environ you tell Python that it has to search on your OS for the needed variable, nothing more. Sounds very technical because it is.

Just remember that using uppercase for the variables in your .env file is the easiest way to not get complications if you want someone else to use your code.

[Sandeep](https://hashnode.com/@sandeepx21)

[Dec 11, 2021](https://hashnode.com/posts/how-to-use-a-env-file-with-python/61b0fe8fccd13f578941ed74/comment/61b192511907c16be2edf80b#reply-61b4862db18f1f0c68300c2b)

Thanks [Lou](https://hashnode.com/@lovelacecoding) :)

I think I understand it now

_Just to summarise:_

Some developers came up with an idea to put all imp password/stuff in a file for security and name it as .env

and

this file will (and should) only be available on local machine and the main server (have to upload file seperately) to ensure safety of resources while sharing code

Finally, this article explain how to access those environment variables using python :\]
