Created
September 9, 2014 08:17
-
-
Save lavie/0657e7a8ac26fc795a78 to your computer and use it in GitHub Desktop.
Django Settings Dev vs. Production Pattern
This file contains 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
# This file contains PRODUCTION setting values. If you want to run this locally, or on a different environment than production, edit the settings_local.py file, instead. | |
# Mongo related settings | |
MONGO_RS = ["mongo1", "mongo2", "mongo3"] | |
DB_USER = "myuser" | |
DB_PASSWORD = "mypawd" | |
DB_TIMEOUT_MS = 3000 | |
REPLICA_SET = "replica" | |
# General application settings | |
LOG_FILE = "/var/log/app/app.log" | |
DEBUG = True | |
try: | |
LOCAL_SETTINGS #@UndefinedVariable | |
except NameError: | |
try: | |
from settings_local import * | |
except ImportError: | |
pass | |
This file contains 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
# Do not commit this file. It is intentionally left out of source control because it contains overriding settings that are different in each environment (production, lab, development). | |
LOCAL_SETTINGS = True | |
from settings import * #@UnusedImport | |
mongo1 = "54.85.193.35" | |
mongo2 = "54.86.169.102" | |
mongo3 = "54.208.117.111" | |
MONGO_RS = [mongo1, mongo2, mongo3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment