Environment Variables for Django Secret Key etc On Windows 10 and Heroku

439 views
Skip to first unread message

dum dum

unread,
Sep 12, 2020, 4:34:14 AM9/12/20
to django...@googlegroups.com
I tried to put my Django Secret Key in Environment Variables.
SECRET_KEY = os.environ.get('SECRET_KEY')
I did save the SECRET_KEY on env var windows 10 like this
image.png


When I tried to py manage.py runserver, I got this error
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
I followed this 

But no idea with the solution..

At this point, strange thing even occurred, I tried to py manage.py without any SECRET_KEY on my Env Var on windows 10, and just leaving 
  SECRET_KEY = os.environ.get('SECRET_KEY'
in my settings.py.

I got no error.

Strange.. But when I deployed it on heroku, it says the same error like this 
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty. 

Is anyone here experienced the same stuck like me? Please kindly advise. Thanks 

Mbah Victor

unread,
Sep 12, 2020, 10:38:41 AM9/12/20
to django...@googlegroups.com
Have you try googling your problem

Victor

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANV3w%3DYdb3SuiC7KYrkN4bfieQx-fQxhm%2BPeMLpxJDWubVbwyA%40mail.gmail.com.

dum dum

unread,
Sep 12, 2020, 12:35:29 PM9/12/20
to django...@googlegroups.com
Yes, I've seen so many tutorials. I did the same thing, and didn't work. 
I believe there is something wrong with my Django Project. I don't know what it is.
Still tinkering.


Message has been deleted

dum dum

unread,
Sep 15, 2020, 2:09:09 AM9/15/20
to django...@googlegroups.com
without any quotes.

image.png



On Tue, Sep 15, 2020 at 5:10 AM coolguy <cooldjango...@gmail.com> wrote:
Did you input the variable value under single quote or without it?

e.g. 'xxxxxxxxxxxxxxxx'

Reply all
Reply to author
Forward
0 new messages