Last active
December 16, 2015 05:59
-
-
Save ferhatelmas/5388081 to your computer and use it in GitHub Desktop.
Usage of environment variables to show a better way of handling settings in django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
exec("from .{0} import *".format(os.environ.get("NAR_ENVIRONMENT", "dev"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
some_configuration_value = os.environ.get('some_configuration_key', 'default_value') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment