Report this

What is the reason for this report?

django secret key export in DO server

Posted on October 20, 2016

I can’t export my django apps secret key using environment variables os.environ.get(‘secret_key’) in production settings file and export secret key on DO server in my project root usind command line. This same file and procedure work fine using heroku config. How do I provide secret key to DO server?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You can find more detail here. But basically you need to have the local environment variable set in the session where django is running. the export command in bash will allow you to do this and adding it to the correct session can further automate the process.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.