Source

pentasubmitter / src / pentasubmitter / settings.py

Full commit
# -*- coding: utf-8 -*-

# Django settings for pentasubmitter project.
import os
import sys
import djcelery

#from django import template
#template.add_to_builtins('voting.templatetags.voting_tags')

BASEDIR = os.path.dirname(__file__)

DEBUG = True
TEMPLATE_DEBUG = DEBUG
ENABLE_SSL = False
COMPRESS_ENABLED = False

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
    ('Frank Becker', 'fb@alien8.de'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = r'./db/database.sql'             # 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.


# e-mail

EMAIL_HOST = 'localhost'
EMAIL_PORT = '25'
#EMAIL_HOST_USER = 'username'
#EMAIL_HOST_PASSWORD = 'xxxxxxxx'
DEFAULT_FROM_EMAIL = 'pentasubmitter@alien8.de'

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

DATE_FORMAT = 'd.m.y'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'

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

# Path to the virtualenv directory
# VIRTUALENV_ROOT = "/srv/virtualenvs/pentasubmitter/"
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
#MEDIA_ROOT = os.getcwd()+'/templates/static'
MEDIA_ROOT = os.path.join(BASEDIR, 'templates')

STATIC_ROOT = os.path.join(BASEDIR, "sitestatic")
#MEDIA_ROOT = STATIC_FILES_ROOT + MEDIA_APP_NAME + '/'
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'


# What to show if screen shot of a url cannot be fetched
NO_PAGE_SCREENSHOT = MEDIA_ROOT + '/page_shots/no_page_shot.png'

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

# Local development means the Django built in server deals with static files.
# Do not use in production.
# http://oebfare.com/blog/2007/dec/31/django-and-static-files/
LOCAL_DEVELOPMENT = True

#PAGINATION_DEFAULT_PAGINATION = 5
#PAGINATION_DEFAULT_WINDOW = 3
if LOCAL_DEVELOPMENT:
    sys.path.insert( 0, "/".join(os.path.dirname(__file__).split('/')[:-1]))
    os.environ['DJANGO_SETTINGS_MODULE'] = "pentasubmitter.settings"

# 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 = '((=zi=gd0@v*^%d#@v=ovl03pur5urpq+x-g#qj01(si@0b=#)'

# 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',
)
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.static',
    'django_authopenid.context_processors.authopenid',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    'pagination.middleware.PaginationMiddleware',
    #'depiction.middleware.ProfilerMiddleware',
    'django_authopenid.middleware.OpenIDMiddleware',
    'pentasubmitter.SSLMiddleware.SSLRedirect',
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

STATICFILES_DIRS = (
    ('css', BASEDIR + '/templates/css'),
    ('js', BASEDIR + '/templates/js'),
    ('images', BASEDIR + '/templates/images'),
    ('pix', BASEDIR + '/templates/pix'),
    ('uni_form', BASEDIR + '/templates/uni_form'),
    ('lib', BASEDIR + '/templates/lib'),
)

INTERNAL_IPS = ('127.0.0.1',)

AUTH_PROFILE_MODULE = "submitter.Submitter"

ugettext = lambda s: s
LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/'))
LOGOUT_URL = '/account/signout'
LOGIN_REDIRECT_URL = '/'

# Tagging
FORCE_LOWERCASE_TAGS = True


# Debug Toolbar
DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.cache.CacheDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
 )



ROOT_URLCONF = 'pentasubmitter.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates"
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.getcwd()+"/templates/"
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.humanize',
    'django.contrib.comments',
    'django.contrib.markup',
    'debug_toolbar',
    'tagging',
    'pagination',
    'south',
    'uni_form',
    'submitter',
    'show',
    'profiles',
    'registration',
    #'djangoratings',
    'voting',
    #'django_openid',
    'django_authopenid',
    'avatar',
    'threadedcomments',
    'haystack',
    'djcelery',
    'tastypie',
    'compressor',
    'south',
)

COMPRESS_PRECOMPILERS = (
            ('text/x-scss', 'pyscss -o {outfile} {infile}'),
            )

COMPRESS_CSS_FILTERS = ['compressor.filters.csstidy.CSSTidyFilter',]

DEBUG_TOOLBAR_CONFIG = dict(
    INTERCEPT_REDIRECTS=False,
)

ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window

SERIALIZATION_MODULES = {
    'json': 'wadofstuff.django.serializers.json'
}

OPENID_SREG = {
    "required": ['fullname', 'country'],
    "optional": 'fullname',
}

COMMENTS_APP = 'threadedcomments'

HAYSTACK_SITECONF = 'pentasubmitter.search_sites'
# HAYSTACK_SEARCH_ENGINE = 'whoosh'
# HAYSTACK_WHOOSH_PATH = '/home/whoosh/mysite_index'
HAYSTACK_SEARCH_ENGINE = 'simple'

HAYSTACK_INCLUDE_SPELLING = True

# django-depiction
#PROFILING = True

# celery
djcelery.setup_loader()

BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"

## submitter
# set url of bot
JABBER_BOT_URL = "http://localhost"
#JABBER_BOT_URL = "http://www.hq.c3d2.de/bot/msg"
SUBMITTER_URL = "http://pentamedia.c3d2.de/submit/"