# -*- coding: utf-8 -*-
import os
WORKPATH = os.path.dirname(os.path.abspath(__file__))
#===============================================================================
# App specific settings
#===============================================================================
# The initial password (user reminder)
INITIAL_PASSWORD = 'my-super-secret-inital-password'
# Your Google Maps API Key for your domain
GOOGLE_MAPS_API_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# Your Askimet API-Key
ASKIMET_API_KEY = 'ABCDEFG'
# Set to 'False' if you do NOT want to check new comments against Askimet
COMMENTS_CHECK_ASKIMET = False
# Set to 'False' if you do NOT want do save Spam-Comments
# Usually this is false, set this to 'True' if you think, you
# get to many false-positives.
COMMENTS_SAVE_SPAM = False
# Max characters allowed in comments
COMMENT_CONTENT_MAX_LENGTH = 1200
# Blacklisted words in comments
# This must be tuple or a list. You can either specify strings or pre-compiled
# regular expressions. See the example for more information:
#
# Example:
# from re import compile
# COMMENT_DISALLOWED_KEYWORDS = (
# 'Viagra', # Fetches 'Viagra' but not 'VIAGRA' or 'ViAGra'
# compile('vi[a|4]?gra'), # Fetches 'viagra' or 'vi4gra'
# )
COMMENT_DISALLOWED_KEYWORDS = (
'URL=', # BBCode Links are not allowed
'casino', # Nobody here wants to gamble
'Casino',
)
#===============================================================================
# Debug and E-Mail settings
#===============================================================================
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
#('Your Name', 'your.email@example.com'),
)
MANAGERS = ADMINS
#===============================================================================
# Cache Settings
#===============================================================================
CACHE_BACKEND = 'db://cache/?timeout=3600'
CACHE_MIDDLEWARE_SECONDS = 3600
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
#===============================================================================
# Database settings
#===============================================================================
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'dev.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
#===============================================================================
# I18N
#===============================================================================
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'de'
SITE_ID = 1
USE_I18N = True
ROOT_URLCONF = 'k9.urls'
#===============================================================================
# Media-Root
#===============================================================================
MEDIA_ROOT = os.path.join(WORKPATH, 'site_media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'
# 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 = '/admin_media/'
# Path for static files
WEB_ROOT = os.path.join(WORKPATH, 'static_cache/htdocs')
#===============================================================================
# Secret Key
# Make this unique, and don't share it with anybody.
#===============================================================================
try:
SECRET_KEY
except NameError:
SECRET_FILE = os.path.join(WORKPATH, 'secret.txt')
try:
SECRET_KEY = open(SECRET_FILE).read().strip()
except IOError:
try:
from random import choice
SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
secret = file(SECRET_FILE, 'w')
secret.write(SECRET_KEY)
secret.close()
except IOError:
Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)
#===============================================================================
# Installed Apps
#===============================================================================
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'k9.apps.member',
'k9.apps.events',
'k9.apps.gallery',
'k9.apps.links',
'k9.apps.news',
'k9.apps.pages',
)
AUTH_PROFILE_MODULE = 'member.Member'
#===============================================================================
# Processors and Loaders
#===============================================================================
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.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'k9.middleware.CachePurgeMiddleware',
# 'django.middleware.cache.CacheMiddleware',
'django.middleware.doc.XViewMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
"django.core.context_processors.debug",
"k9.context_processors.link_categories",
)
TEMPLATE_DIRS = [os.path.join(WORKPATH, 'templates')]
# Import local settings
try:
from settings_secrets import *
except ImportError:
pass