~bkroeze/banjo/banjo

1
2
3
4
5
6
7
8
9
10
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# -*- coding: utf-8 -*-
# Django settings for Banjo Site.

from banjo.common.util import files, logs
import os.path

SITE_ID = 1
SITE_NAME = "getbanjo.com"

SECRET_KEY = 'your key here'

MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'static/')

# a simple interface to turn on and off debugging.  Just put these flags in your MEDIA_ROOT and
# it will automatically flip the system into debug mode.
DEVELOPMENT_MODE = files.exists(MEDIA_ROOT + "_DEVELOPMENT_FLAG")

# a simple interface to allow different settings on a dev and live server.  Just put the flag
# file on the dev server.
LOCAL_DEV = files.exists(MEDIA_ROOT + "_LOCAL_FLAG")

TEMPLATE_DEBUG = DEBUG = DEVELOPMENT_MODE

if DEBUG:
    _loglevel = logs.DEBUG
else:
    _loglevel = logs.INFO

LOG = logs.getLogger("settings", outfile="/var/log/webapps/banjo.log:10000000:5", level={'root' : _loglevel, 'caching' : logs.INFO})

if LOCAL_DEV:
    LOG.debug("DEVELOPMENT MODE")
    MEDIA_URL = '/static/'
    ADMIN_MEDIA_PREFIX = '/static/admin/'
    BASE_SERVER = "http://localhost:8000"
else:
    MEDIA_URL = '/static/'
    ADMIN_MEDIA_PREFIX = '/static/admin/'
    BASE_SERVER="http://getbanjo.com"

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'banjo'
DATABASE_USER = 'banjo'
DATABASE_PASSWORD = 'password-here'
DATABASE_HOST = ''
DATABASE_PORT = ''

EMAIL_HOST = 'getbanjo.com'
EMAIL_HOST_USER="bruce"
EMAIL_FROM = 'bruce@getbanjo.com'
EMAIL_HOST_PASSWORD="email password"

TEMPLATE_DIRS = (
    r'/opt/webapps/banjo/templates',
)

ACCOUNT_ACTIVATION_DAYS = 3

#CACHE_BACKEND = "file:///var/tmp/django_cache"
CACHE_BACKEND = "memcached://127.0.0.1:11211/"
CACHE_TIMEOUT = 60*5
CACHE_PREFIX = "BJ"

SESSION_COOKIE_NAME ='BANJO'

ADMINS = (
    ('Your Name', 'name@getbanjo.com'),
)

MANAGERS = ADMINS

# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
TIME_ZONE = 'America/Los_Angeles'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

DEFAULT_FROM_EMAIL = 'name@getbanjo.com'
EMAIL_SUBJECT_PREFIX = "Banjo:"
SERVER_MAIL="system@getbanjo.com"

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'banjo.common.skins.loader.load_template_source',
    '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.middleware.gzip.GZipMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.middleware.doc.XViewMiddleware",
    "banjo.blog.middleware.BlogMiddleware",
    "banjo.common.middleware.P3PMiddleware"
)

# If you are using the P3PMiddleware above, you'll want to
# make a p3p.xml file, a policy file, and generate your own compact header.

ROOT_URLCONF = 'banjo.urls'

SESSION_EXPIRE_AT_BROWSER_CLOSE = False

USE_ETAGS = True

import banjo

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.sessions',
    'django.contrib.sites',
) + banjo.BANJO_BASE_APPS + (
    'registration',
    'typogrify',
    # all the following are optional
    'banjo.addons.blogroll',
    'extensions',
)

# add the base skin directory
SKIN_DIRS = (
    reduce(os.path.join, (os.path.dirname(banjo.__file__), "blog", "templates", "skins")),
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    'django.core.context_processors.request',
) + banjo.BANJO_TEMPLATE_CONTEXT_PROCESSORS

from banjo.blog.syndication import XMLRPC_METHODS