Django apache environment variables

I have a django project in which environment variables from a .env file work just fine in development mode, I can read them in my by using

SECRET_KEY = os.getenv('SECRET_KEY')

but when I confugure the project in the apache httpd.conf and access the django project, the error log complains about the missing values. How can I load those values to the apache server?

Well, the solution was to use this library: I hope it could be useful for someone in the future.

Back to Top