# Django settings for pycon project.

import os
## help do development on multiple machines dynamicly
DEV_INSTALL_ROOT = os.path.dirname(os.path.dirname(__file__))
if os.sep != '/': DEV_INSTALL_ROOT = DEV_INSTALL_ROOT.replace(os.sep, '/')

DEBUG = True
TEMPLATE_DEBUG = DEBUG


ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'postgresql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'pycon2006'    # Or path to database file if using sqlite3.
DATABASE_USER = 'postgres'     # Not used with sqlite3.
DATABASE_PASSWORD = 'pycon2006' # Not used with sqlite3.
DATABASE_HOST = 'localhost'    # 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 = 'America/Chicago'

# 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 = 'en-us'

SITE_ID = 1

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = DEV_INSTALL_ROOT + '/media'

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
MEDIA_URL = 'http://us.pycon.org/common/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = 'http://us.pycon.org/common/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '!ph!d^%to@m78h@2z*te7yy*2&u!(!csq+5&8$$aje!afkrkdk'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.core.template.loaders.filesystem.load_template_source',
    'django.core.template.loaders.app_directories.load_template_source',
    'pycon.core.template_loaders.load_php_template_source',
#     'django.core.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    ##"django.middleware.cache.CacheMiddleware", ## breaks tooo much
    "django.middleware.common.CommonMiddleware",
    "django.middleware.sessions.SessionMiddleware",
    "django.middleware.doc.XViewMiddleware",
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "pycon.core.context_processors.crumbs",
)

ROOT_URLCONF = 'pycon.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates".
    # Always use forward slashes, even on Windows.
    DEV_INSTALL_ROOT + '/pycon/templates',
)

INSTALLED_APPS = (
    "django.contrib.admin",
    "pycon.apps.survey",
    "pycon.apps.roomy",
    "pycon.apps.mappy",
    'pycon.apps.maps',
)

CACHE_BACKEND = "locmem:///?timeout=300"
#CACHE_MIDDLEWARE_SECONDS = 300
#MAX_DURATION = 180

## used by pycon.apps.maps
## This is assigned to http://localhost:8000/apps/maps/
GOOGLE_MAPS_KEY="ABQIAAAA72mjocDxVHMiQWCb2hiCsRQQRSxhr_qtwumGHA9HeT4IsKdxChQis_m8tp1kejuLVHdWhBX0w7SHIA"

## used by pycon.core.template_loaders
PHP_BIN = 'cat'
PHP_TEMPLATE_FILE_EXTENSION='.txt'
PHP_TEMPLATE_DIRS = (
    DEV_INSTALL_ROOT + '/pycon/core',
)
