Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django: Secret key published #52

Open
programmdesign opened this issue May 12, 2015 · 3 comments
Open

Django: Secret key published #52

programmdesign opened this issue May 12, 2015 · 3 comments

Comments

@programmdesign
Copy link
Contributor

Using environment variables is not a best practice. Probably reword the section to "Alternatives" an point out the downside of usinging environment variables.

@Glueon
Copy link
Contributor

Glueon commented May 18, 2015

Why not? That is mentioned as a solution in Django Two Scoops as well as the json file-like solution.

Also it's very populat among developers (including myself) who use docker for deployments.

@programmdesign
Copy link
Contributor Author

@Glueon: Anytime you have to store a password, it is insecure. Environment variables are of course better that storing your secret key openly in your repo (hence: better practice). However, it is considered best practice, to encrypt secret data. There are several tools out there the help you read secret data from encrypted files. If you use ansible, have a look at https://docs.ansible.com/playbooks_vault.html. Also simplecrypt is an option: https://pypi.python.org/pypi/simple-crypt

@Glueon
Copy link
Contributor

Glueon commented May 18, 2015

The main goal of using playbooks_vaults is to be able to store sensitive data in a SVC.

But I do not see such a need for Django as soon as you have a proper seperation of settings files, where have a dev and prod settings modules which inherit from a base one. Base is in a SVC others - no.

Also you'll have to supply that password using for example ENV variable. But why not just pass a secret key using the an ENV?

An example could help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants