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

Remove secret key from settings and change it before deploying to production #3

Open
PresidentNick opened this issue Aug 18, 2020 · 2 comments
Assignees

Comments

@PresidentNick
Copy link

I forgot to make a secrets file to store sensitive django settings. We'll need to do make a secrets file and change the secret key before we deploy it anywhere. It's fine for now since we're just running this locally.

@PresidentNick PresidentNick self-assigned this Aug 18, 2020
@Phaen
Copy link
Member

Phaen commented Aug 18, 2020

Ideally to deploy it on our server, the secret key would be sourced from the environment. Is there any easy way to do that, with a gitignored secrets file as backup for those that prefer it?

@PresidentNick
Copy link
Author

Usually with the settings file there is a base.py settings, a dev.py, and prod.py, and a local.py. They all inherit from base and overwrite settings for the respective environment.

dev.py example:

from .base import *

#all of the dev.py settings here

try:
    from .local import * # overwrite with local settings
except ImportError:
    pass

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