Skip to content

Instantly share code, notes, and snippets.

@mliu7
Created June 5, 2010 16:29
Show Gist options
  • Save mliu7/426747 to your computer and use it in GitHub Desktop.
Save mliu7/426747 to your computer and use it in GitHub Desktop.
import socket
def contains(str, substr):
if str.find(substr) != -1:
return True
else:
return False
if contains(socket.gethostname(), 'webfaction'):
LIVEHOST = True
else:
LIVEHOST = False
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
if LIVEHOST:
DEBUG = False
EMAIL_HOST = 'smtp.webfaction.com'
EMAIL_HOST_USER = 'mliu'
EMAIL_HOST_PASSWORD = 'xxx'
DEFAULT_FROM_EMAIL = 'xxx@xxx.com'
SERVER_EMAIL = 'xxx@xxx.com'
MEDIA_ROOT = '/home/mliu/webapps/media/'
MEDIA_URL = 'http://markliu.me/media/'
ADMIN_MEDIA_PREFIX = 'http://markliu.me/media/admin/'
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'xxx'
DATABASE_USER = 'xxx'
DATABASE_PASSWORD = 'xxx'
DATABASE_HOST = ''
DATABASE_PORT = ''
else:
DEBUG = False
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media/')
MEDIA_URL = 'http://127.0.0.1:8000/media/'
ADMIN_MEDIA_PREFIX = '/amedia/'
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(PROJECT_ROOT, 'mark-liu.db')
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment