3

When trying to deploy a django app to heroku using django-configurations, I keep getting the error:

ValueError: Couldn't setup configuration 'config.settings.Production': Secret value 'SECRET_KEY' is not set

However, when I run heroku config:get SECRET_KEY, I do get a result. It is the same value that set it to. I randomly generated a string on my local environment and set that string to the environment value SECRET_KEY by running heroku config_set SECRET_KEY=ASFASDF

The appropriate line with my settings.py file is:

SECRET_KEY = values.SecretValue()

I can't figure out why django-configurations doesn't seem to be able to pick up this particular environment variable ...

JJD
  • 77
  • 1
  • 10
Aviendha
  • 159
  • 1
  • 3

1 Answers1

2

after reading_the_source_code for django_configurations, I discovered that the value that it is actually looking for by default is DJANGO_SECRET_KEY. Setting the environment variable to that instead made everything work out.

Aviendha
  • 159
  • 1
  • 3