Question

django secret key export in DO server

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?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.