Skip to content

Instantly share code, notes, and snippets.

@miratcan
Created July 14, 2011 13:36
Show Gist options
  • Save miratcan/1082464 to your computer and use it in GitHub Desktop.
Save miratcan/1082464 to your computer and use it in GitHub Desktop.
settings.py that running on both remote and local server.
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