# Django settings for mokeladmin project.

import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

AUTH_PROFILE_MODULE = "mail.UserProfile"

LOGIN_URL = "/mokel/login"
LOGIN_REDIRECT_URL = "/mokel/mail/"
LOGOUT_URL = "/mokel/logout"

CACHE_BACKEND = 'db://cache_table'

# Choose your engine
# 'postgresql', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'ado_mssql'.
#DATABASE_ENGINE = 'mysql'
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = ""
DATABASE_USER = ""
DATABASE_PASSWORD = ""

SECRET_KEY = ""

DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '5432'             # Set to empty string for default. Not used with sqlite3.

# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
TIME_ZONE = 'Europe/Berlin'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'de-de'

SITE_ID = 1

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/admin-media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".

# Make this unique, and don't share it with anybody.

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'urls'


INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'mail',
    'oldmail',
)

# import local settings overriding the defaults
try:
    from local_settings import *
except ImportError:
    try:
        from mod_python import apache
        apache.log_error( "local_settings.py not set; using default settings", apache.APLOG_NOTICE )
    except ImportError:
        import sys
        sys.stderr.write( "local_settings.py not set; using default settings\n" )

TEMPLATE_DIRS = (
    "%s/templates" % BASE_DIR,
    # Put strings here, like "/home/html/django_templates".
    # Always use forward slashes, even on Windows.
)

# let environment override local settings
if os.environ.has_key('DATABASE_NAME'):
    DATABASE_NAME = os.environ['DATABASE_NAME']
if os.environ.has_key('DATABASE_PASSWORD'):
    DATABASE_PASSWORD = os.environ['DATABASE_PASSWORD']
if os.environ.has_key('DATABASE_ENGINE'):
    DATABASE_ENGINE = os.environ['DATABASE_ENGINE']
if os.environ.has_key('SECRET_KEY'):
    SECRET_KEY = os.environ['SECRET_KEY']

