Closed dsbyprateekg closed 4 years ago
I just found my issue.
It was not due to equal to sign in secret key. In fact I have given my env file a name but it should be only .env.
After changing file from cred.env
to .env
it is working.
add .env file and add this SCOUT_KEY ='' SCOUT_NAME = '' in .env file then pip install scout-apm then Its working
Hey @dsbyprateekg ,My file name is already .env but still error is coming.
SECRET_KEY = config('SECET_KEY')
File "/opt/venv/lib/python3.8/site-packages/decouple.py", line 243, in __call__
return self.config(*args, **kwargs)
File "/opt/venv/lib/python3.8/site-packages/decouple.py", line 105, in __call__
return self.get(*args, **kwargs)
File "/opt/venv/lib/python3.8/site-packages/decouple.py", line 90, in get
raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))
decouple.UndefinedValueError: SECET_KEY not found. Declare it as envvar or define a default value.
What to do now
Hey @abhishekcaritor,I also tried what you said,but still error is coming.
Has a solution for this been found? I'm having the same issues while trying to deploy my Django API on Pythonanywhere. I've followed the docs word for word and got it setup but am still getting this error.
Hi @apoorvthedude, Please check your .env file. I think it's missing.
Hi @apoorvthedude, Please check your .env file. I think it's missing.
I am facing this problem and my .env is okay but still getting the error
Has a solution for this been found? I'm having the same issues while trying to deploy my Django API on Pythonanywhere. I've followed the docs word for word and got it setup but am still getting this error.
How did you solve this, bro?
Has a solution for this been found? I'm having the same issues while trying to deploy my Django API on Pythonanywhere. I've followed the docs word for word and got it setup but am still getting this error.
How did you solve this, bro?
Still unsolved, just switched to Flask and deployed via Render.
Okay, Thank you
On Wed, Mar 29, 2023 at 4:03 PM Ryan Dhingra @.***> wrote:
Has a solution for this been found? I'm having the same issues while trying to deploy my Django API on Pythonanywhere. I've followed the docs word for word and got it setup but am still getting this error.
How did you solve this, bro?
Still unsolved, just switched to Flask and deployed via Render.
— Reply to this email directly, view it on GitHub https://github.com/HBNetwork/python-decouple/issues/99#issuecomment-1488800049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR4MROU4MPTRZSSBA2QDXO3W6RFKRANCNFSM4P5YNOYQ . You are receiving this because you commented.Message ID: @.***>
is it possible to create a ".env" file in a dist folder? I keep getting this error and I created the ".env" file in my dist folder but apparently it's not reading it. Any help here is appreciated. I used pyinstaller to create an exe of my python script but keep getting that error. It works outside of my dist folder but not inside my dist folder.
@enyfour5 .env is searched starting on the main module directory going upwards on the directory tree. You can specify a file by:
from decouple import Config, RepositoryEnv
config = Config(RepositoryEnv("path/to/env_file"))
en settings.py completa la línea como sale debajo: SECRET_KEY = config('SECRET_KEY', default='mydefaultvalue')
def set_token(my_secret): load_dotenv(find_dotenv) TOKEN = os.environ['secret_key']
in the program file: SECRET_KEY = config('SECRET_KEY') and in the .env: SECRET_KEY=B!1w8*NAt1T^%kvhUI34g
Hi,
I am getting following error-
raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option)) decouple.UndefinedValueError: SECRET_KEY not found. Declare it as envvar or define a default value.
Issue seems with the secret key starting with equal to (=) sign. For example with below secret key:
SECRET_KEY = =xg583qt1rc*lec39dy6mtdlg@#v+m0a51no&2@l9fz^nkh&1f