# Django settings for spatialreferences project.

import os
ROOT_PROJECT_FOLDER = os.path.dirname(__file__)

DEBUG = False 
DEBUG =True 
TEMPLATE_DEBUG = False

GMAP_API_KEY = 'abcd'

GRATICULE_DATA = os.path.join(ROOT_PROJECT_FOLDER,'graticules/data')

ADMINS = (
     ('Howard Butler', 'hobu.inc@gmail.com'),
     ('Christopher Schmidt', 'crschmidt@crschmidt.net'),
     ('Dane Springmeyer', 'dane.springmeyer@gmail.com'),
)

MANAGERS = ADMINS

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
    'django.core.context_processors.auth', 
    )

RECAPTCHA_PUBLIC_KEY="6LdqtAMAAAAAAKSF9XhMCel1SmIstzbuVmlrCQgm"
RECAPTCHA_PRIVATE_KEY="6LdqtAMAAAAAAKKKj8vo6BHjw9epVjyISi6gUVxR"

#CACHE_MIDDLEWARE_SECONDS=3600
#CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True
#CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=30&max_entries=400"

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'srorg',
        'USER': 'postgres',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '5432',
    }
}

# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Los_Angeles'

# 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

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

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

MEDIA_ROOT = os.path.join(ROOT_PROJECT_FOLDER,'templates/media')

STATIC = os.path.join(ROOT_PROJECT_FOLDER,'templates/static')

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

# 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 = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'kzkt842fp40=t8jyq9cc^y2^)c9tx*%#h6r+rzxsj+hc@a0)oj'

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

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
TEMPLATE_CONTEXT_PROCESSORS += (
     'django.core.context_processors.request',
) 

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
#    'django.middleware.cache.CacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = (
    os.path.join(ROOT_PROJECT_FOLDER, 'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.comments',
    'django.contrib.flatpages',
    'django.contrib.humanize',
    'django.contrib.gis',
    'geocoder',
    'registration',
    'batchadmin',
    'recaptcha',
    'epsg',
    'srsbrowser',
)

try:
    from local_settings import *
except ImportError, exp:
    pass

#GEOS_LIBRARY_PATH = "/Library/Frameworks/GEOS.framework/Versions/3.0/unix/lib/libgeos_c.dylib"
