settings.py 5.21 KB
Newer Older
fred's avatar
fred committed
1 2 3 4 5
#!/usr/bin/env python
# coding: utf-8

import os

fred's avatar
fred committed
6 7
import django.conf.global_settings as DEFAULT_SETTINGS

fred's avatar
fred committed
8 9
DEBUG = True  # Turn off for production
TEMPLATE_DEBUG = DEBUG
fred's avatar
fred committed
10
DEBUG_TOOLBAR = True
fred's avatar
fred committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DEFAULT_FROM_EMAIL = 'info@radiopanik.org'

LOGIN_REDIRECT_URL = '/'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(PROJECT_DIR, 'panikweb.sqlite3'),
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    },
}

ACCOUNT_ACTIVATION_DAYS = 7  # Activation window

#if django.VERSION[:2] < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'

# 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/Brussels'

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

LANGUAGES = (
  ('fr', u'Français'),
)

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

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
fred's avatar
fred committed
65
MEDIA_URL = '/media/'
fred's avatar
fred committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
fred's avatar
fred committed
89
    'compressor.finders.CompressorFinder',
fred's avatar
fred committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '3qm&amp;@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
fred's avatar
fred committed
104
    'django.middleware.cache.UpdateCacheMiddleware',
fred's avatar
fred committed
105 106 107 108 109 110
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
fred's avatar
fred committed
111 112
    'fiber.middleware.ObfuscateEmailAddressMiddleware',
    'fiber.middleware.AdminPageMiddleware',
fred's avatar
fred committed
113
    #'request.middleware.RequestMiddleware',
fred's avatar
fred committed
114
    'django.middleware.cache.FetchFromCacheMiddleware',
fred's avatar
fred committed
115 116
)

fred's avatar
fred committed
117 118 119 120 121
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
    'django.core.context_processors.request',
)


fred's avatar
fred committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
ROOT_URLCONF = 'panikweb.urls'

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

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
139
    'south',
fred's avatar
fred committed
140
    'haystack',
141
    'taggit',
fred's avatar
fred committed
142
    'panikweb_templates',
fred's avatar
fred committed
143
    'panikweb.paniktags',
fred's avatar
fred committed
144 145 146
    'mptt',
    'compressor',
    'fiber',
fred's avatar
fred committed
147 148 149 150 151 152 153 154 155
    'jquery',
    'ckeditor',
    'emissions',
    'newsletter',
)

CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'

fred's avatar
fred committed
156 157 158
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
159
        'URL': 'http://127.0.0.1:8985/solr/panik'
fred's avatar
fred committed
160 161
    },
}
fred's avatar
fred committed
162

fred's avatar
fred committed
163 164 165 166
FIBER_TEMPLATE_CHOICES = (
    ('tpl-default.html', 'Default template'),
)

fred's avatar
fred committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
try:
    from local_settings import *
except ImportError, e:
    pass

if DEBUG and DEBUG_TOOLBAR:
    MIDDLEWARE_CLASSES += (
        'debug_toolbar.middleware.DebugToolbarMiddleware',
    )
    INSTALLED_APPS += (
        'debug_toolbar',
    )
    DEBUG_TOOLBAR_CONFIG = {
        'INTERCEPT_REDIRECTS': False,
    }