Closed Jlarranaga closed 9 months ago
How are you using your environment variables in your settings file?
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': env('NAME'), 'USER': env('USER'), 'PASSWORD': env('PASSWORD'), 'HOST': env('HOST'), 'PORT': env('PORT'), 'OPTIONS': {'sslmode': 'require'}, } }
Is this happening on everyone's machine? My first guess is that something is improperly formatted with the PASSWORD value on the env file
Yeah its everyone's
Can you get rid of options?
I'm deleting your last comment so the env info isn't public, but the file looks properly formatted
Ok thank you, and let me try that
I commented it out and still didnt work
For the project I accidently added an extra folder layer. Would that mess with the env file being an extra layer higher?
It could - the env file needs to be at the same level as manage.py
Yeah, it's on the same level
So I'm reading we need to set the variables. And online it says set the variables in the terminal? But we do that everytime?
You shouldn't have to do that every time.
FIXED! .env file needs to be in the same folder as settings.py
Describe the bug A clear and concise description of what the bug is.
Terminal is saying .env file has an keyerror
What is the problem you are trying to solve?
get .en file to work properly
Expected behavior A clear and concise description of what you expected to happen. need to use env file for access to database
What is the actual behavior? A clear and concise description of what actually happened.
Post any code you think might be relevant (one fenced block per file)
What is your best guess as to the source of the problem?
Not sure, maybe env file is being read wrong
What things have you already tried to solve the problem?
Team member collab, google
Additional context Add any other context about the problem here.
Paste a link to your repository here https://github.com/Jlarranaga/Project3-DreamHues