import os
import sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append('/srv/packages/lib/')
sys.path.append(os.path.join(PROJECT_ROOT, 'apps'))
# ##############################################################################
# App specific settings
# ##############################################################################
# Comments
COMMENT_MAX_LENGTH = 3200
COMMENT_NAME_MAX_LENGTH = 50
COMMENT_USERNAME_MAX_WORD_LENGTH = 20
# Tagging
FORCE_LOWERCASE_TAGS = True
# Registration
ACCOUNT_ACTIVATION_DAYS = 3
ACCOUNT_DEFAULT_PERMISSONS = ('add_entry', 'change_entry')
LOGIN_REDIRECT_URL = "/"
TEMPLATECOMPONENTS_PATH_TO_YUICOMPRESSOR_JAR = os.path.join(PROJECT_ROOT, 'site_media', 'yuicompressor-2.3.5.jar')
TEMPLATECOMPONENTS_COMPRESS_JAVASCRIPT = True
TEMPLATECOMPONENTS_COMPRESS_CSS = True
# ##############################################################################
# Debug and Mail-Settings
# ##############################################################################
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Martin Mahner', 'martin@mahner.org'),
)
MANAGERS = ADMINS
USE_ETAGS = True
APPEND_SLASH = True
EMAIL_HOST = 'localhost'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
# ##############################################################################
# Application and Middleware Settings
# ##############################################################################
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
# Ext
#'sorl.thumbnail',
'registration',
'tagging',
'rosetta',
'pagination',
# Self
'accounts',
'weblog',
'comments',
)
AUTH_PROFILE_MODULE = 'accounts.profile'
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',
'djangohq.context_processors.auth',
'djangohq.context_processors.road_to_10',
'weblog.context_processors.popular',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.gzip.GZipMiddleware',
'pagination.middleware.PaginationMiddleware',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, 'templates'),
)
# ##############################################################################
# Database Settings
# ##############################################################################
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
# ##############################################################################
# Language and I18N
# ##############################################################################
USE_I18N = True
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'de'
LANGUAGES = (
('de', 'German'),
)
INTERNAL_IPS = ('127.0.0.1',)
# ##############################################################################
# URL and Path Settings
# ##############################################################################
SITE_ID = 1
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media')
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/admin_media/'
ROOT_URLCONF = 'djangohq.urls'
# ##############################################################################
# Secret Key
# Make this unique, and don't share it with anybody.
# ##############################################################################
try:
SECRET_KEY
except NameError:
SECRET_FILE = os.path.join(PROJECT_ROOT, '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)
try:
from local_settings import *
except ImportError:
pass