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

proposal: re-organize settings inheritance for staging & production #102

Closed
tobiasmcnulty opened this issue Jul 7, 2014 · 5 comments · Fixed by #155
Closed

proposal: re-organize settings inheritance for staging & production #102

tobiasmcnulty opened this issue Jul 7, 2014 · 5 comments · Fixed by #155
Assignees

Comments

@tobiasmcnulty
Copy link
Member

The fact that production settings inherit from staging settings is confusing and easily gets you into a state where you accidentally deploy a staging setting to production because you forgot to remove it in the production settings file.

I'd vote for having both files inherit from the same parent settings, or staging inheriting from production. More often than not, you'll want to disable or tweak certain things active on production (or add extra logging, for example) in the staging environment , rather than the other way around.

@dpoirier
Copy link
Contributor

dpoirier commented Jul 7, 2014

Maybe have them both inherit from a settings file named "deployed" or "remote"?

@tobiasmcnulty
Copy link
Member Author

Sounds reasonable to me - it would be the gunicorn equivalent of the dev.py settings.

@mlavin
Copy link
Contributor

mlavin commented Jul 7, 2014

Related to this I'd like to see more of these settings pushed into the environment (like DB name/user) so that the settings file doesn't need to know the convention used by the Salt configuration. That change along with giving these a common parent would make #103 easier.

@tobiasmcnulty tobiasmcnulty added this to the Ship It Day July 2014 milestone Jul 11, 2014
@mlavin
Copy link
Contributor

mlavin commented Mar 6, 2015

In a more recent project we are taking the following approach to address this. We have removed the staging and production settings in favor of a single live settings. Settings are configured via environment variables. For the DB settings we use https://github.com/kennethreitz/dj-database-url. We do pass the name of the environment in the os.environ so we can have conditional settings blocks. For instance the live settings are used by the Vagrant setup and we disable email sending (write to the console).

@dpoirier
Copy link
Contributor

dpoirier commented Mar 9, 2015

This sounds good to me.

@mlavin mlavin self-assigned this Apr 17, 2015
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

Successfully merging a pull request may close this issue.

3 participants