# Django settings for eatslugs project.

# Rather than editing settings here, add them to the localsettings.py file
# which will be included at the end of the run and replace anything in here.

import os
topdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    ('Brett Parker', 'iDunno@sommitrealweird.co.uk'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': os.path.join(topdir, 'eatslugs.db')
    }
}

TIME_ZONE = 'Europe/London'

LANGUAGE_CODE = 'en-gb'

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

MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
MEDIA_URL = '/media/'

ADMIN_MEDIA_PREFIX = '/admin-media/'

import random
import string
key_chars = "%s%s%s" %(string.letters, string.digits, '+-()_#~')
SECRET_KEY = "".join([random.choice(key_chars) for a in range(0,50)])

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

ROOT_URLCONF = 'urls'

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

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(topdir, 'templates'),],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.core.context_processors.debug',
                'django.core.context_processors.i18n',
                'generic.context_processors.media',
            ],
            'debug': True,
        },
    },
]


try:
    from localsettings import *
except:
    pass

