Created
July 14, 2011 13:36
-
-
Save miratcan/1082464 to your computer and use it in GitHub Desktop.
settings.py that running on both remote and local server.
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
from os import uname, getcwd | |
from os.path import join | |
MACHINE_NAME = uname()[1] | |
if MACHINE_NAME == "XXX.webfaction.com": | |
DOCUMENT_ROOT = "/path/to/document/" | |
DATABASE_ENGINE = ... | |
DATABASE_NAME = ... | |
DATABASE_USER = ... | |
DATABASE_PASSWORD = ... | |
DATABASE_HOST = ... | |
DATABASE_PORT = ... | |
else: | |
DOCUMENT_ROOT = getcwd() | |
DATABASE_ENGINE = 'sqlite3' | |
DATABASE_NAME = join(DOCUMENT_ROOT,'sqlite3.db') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment