Source

Ochs / settings.py

import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    ('Jay Baird', 'jay@ochscms.org'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'ochscms'             # Or path to database file if using sqlite3.
DATABASE_USER = 'jbaird'             # 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.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available 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/New_York'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
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 = False

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/home/jbaird/ochscms/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 = 'http://ochscms.org/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 = '/media/admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '8#rtnd1r5+6m7pr=z(4%_x&z(087-sbbu9rhg*qru#&&$49-!e'

AUTHENTICATION_BACKENDS = (
    'lib.auth_backends.ProfileModelBackend',
    'django.contrib.auth.backends.ModelBackend',
)

# List of callables that know how to import templates from various sources.
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.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.user.CurrentUserMiddleware'
)

ROOT_URLCONF = 'urls'

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

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

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'cms',
    'cms.plugins.file',
    'cms.plugins.flash',
    'cms.plugins.googlemap',
    'cms.plugins.link',
    'cms.plugins.picture',
    'cms.plugins.teaser',
    'cms.plugins.text',
    'mptt',
    'disqus',
    'south',
    'tinymce',
    'tagging',
    'haystack',
    'ochs_filebrowser',
    'photologue',
    'publisher',
    'reversion',
    'compress',
    'news',
    'ochs_media',
    'courses',
    'staff',
)

FLICKR_USER_ID = '20059122@N00'
FLICKR_API_KEY = '132efbd7070f25b0bc4855a9f18fa80d'
FLICKR_TAG_PREDICATE = 'utk'

CLOUDFILES_USERNAME = 'jbaird'
CLOUDFILES_API_KEY = '8eb2ac0ba08997a417f9f7a72a80e0a1'
CLOUDFILES_CONTAINER = 'ochscms.org'
CLOUDFILES_TTL = 600
DEFAULT_FILE_STORAGE = 'backends.mosso.CloudFilesStorage'

COMPRESS = True
COMPRESS_VERSION = True
COMPRESS_CSS_FILTERS = []
COMPRESS_CSS = {
    'screen': {
        'source_filenames': ('css/screen.css','css/ochsbase.css','css/blueprint/screen.css'),
        'output_filename': 'css/screen.r?.css',
        'extra_context': {
            'media': 'screen,projection',
        },
    },
}
COMPRESS_JS = {
    'all': {
        'source_filenames': ('',),
        'output_filename': 'js/all.r?.js',
    }
}

DISQUS_API_KEY = 'WV6KFpk2qYpK2IH59a8S12R2dy8cmLObA98YNnUvye0RakL4lIE5ovymVP5RvAT5'
DISQUS_WEBSITE_SHORTNAME = 'ochscms'

gettext = lambda s: s

CMS_TEMPLATES = (
   ('homepage_01.html', gettext('Homepage 1 Template')),
   ('homepage_02.html', gettext('Homepage 2 Template')),
   ('news/news_section.html', gettext('Section Template')),
   ('story_2col.html', gettext('2 Column Story Template')),
   ('story_3col.html', gettext('3 Column Story Template')),
   ('story_feature.html', gettext('Feature Story Template'))
)

CMS_PLACEHOLDER_CONF = {
    'homepage_main_story': {
        'plugins': ('OchsMainStoryPlugin',),
        'extra_context': {},
        'name': gettext('Homepage Main Story Slot'),
    },
    'homepage_news_slot': {
        'plugins': ('OchsStoryPlugin',),
        'extra_context': {'summary': True},
        'name':gettext("Homepage News Slot")
    },
    'right-column': {
        'plugins': ('TeaserPlugin', 'LinkPlugin', 'PicturePlugin'),
        'extra_context': {'theme':'small'},
        'name':gettext("Right Column")
    }
}

CMS_SEO_FIELDS = True
CMS_MODERATOR = True

CMS_DEFAULT_LANGUAGE = 'en'
CMS_LANGUAGES = (
    ('en', gettext('English')),
)

TINYMCE_JS_URL = os.path.join(MEDIA_URL, 'js/tiny_mce/tiny_mce_src.js')
TINY_MCE_DEFAULT_CONFIG = {
    'plugins': 'table,paste,searchreplace',
    'theme': 'advanced',
    'cleanup_on_startup': True,
    'custom_undo_redo_levels': 10,
}

HAYSTACK_SITECONF = 'search_sites'
HAYSTACK_SEARCH_ENGINE = 'whoosh'
HAYSTACK_WHOOSH_PATH = os.path.join(PROJECT_ROOT, 'ochs_index')

FILEBROWSER_URL_FILEBROWSER_MEDIA = os.path.join(MEDIA_URL, 'filebrowser/')
FILEBROWSER_URL_WWW = os.path.join(MEDIA_ROOT, 'uploads')

FORCE_LOWERCASE_TAGS = True