132
by Bruce Kroeze
added coding declaration to all files where it is missing |
1 |
# -*- coding: utf-8 -*-
|
64
by Bruce Kroeze
changing settings around a bit to support testing |
2 |
# Django settings for Banjo Site.
|
3 |
||
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
4 |
from banjo.common.util import files, logs |
157
by Bruce Kroeze
updated installation docs |
5 |
import os.path |
64
by Bruce Kroeze
changing settings around a bit to support testing |
6 |
|
7 |
SITE_ID = 1 |
|
8 |
SITE_NAME = "getbanjo.com" |
|
9 |
||
10 |
SECRET_KEY = 'your key here' |
|
11 |
||
157
by Bruce Kroeze
updated installation docs |
12 |
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'static/') |
64
by Bruce Kroeze
changing settings around a bit to support testing |
13 |
|
14 |
# a simple interface to turn on and off debugging. Just put these flags in your MEDIA_ROOT and
|
|
15 |
# it will automatically flip the system into debug mode.
|
|
16 |
DEVELOPMENT_MODE = files.exists(MEDIA_ROOT + "_DEVELOPMENT_FLAG") |
|
17 |
||
18 |
# a simple interface to allow different settings on a dev and live server. Just put the flag
|
|
19 |
# file on the dev server.
|
|
20 |
LOCAL_DEV = files.exists(MEDIA_ROOT + "_LOCAL_FLAG") |
|
21 |
||
22 |
TEMPLATE_DEBUG = DEBUG = DEVELOPMENT_MODE |
|
23 |
||
24 |
if DEBUG: |
|
25 |
_loglevel = logs.DEBUG |
|
26 |
else: |
|
27 |
_loglevel = logs.INFO |
|
28 |
||
86
by Bruce Kroeze
removing configsettings and keycache - moving to use of the satchmo versions of these |
29 |
LOG = logs.getLogger("settings", outfile="/var/log/webapps/banjo.log:10000000:5", level={'root' : _loglevel, 'caching' : logs.INFO}) |
64
by Bruce Kroeze
changing settings around a bit to support testing |
30 |
|
31 |
if LOCAL_DEV: |
|
32 |
LOG.debug("DEVELOPMENT MODE") |
|
157
by Bruce Kroeze
updated installation docs |
33 |
MEDIA_URL = '/static/' |
64
by Bruce Kroeze
changing settings around a bit to support testing |
34 |
ADMIN_MEDIA_PREFIX = '/static/admin/' |
128
by Bruce Kroeze
putting a base wireframe skin in for default |
35 |
BASE_SERVER = "http://localhost:8000" |
64
by Bruce Kroeze
changing settings around a bit to support testing |
36 |
else: |
157
by Bruce Kroeze
updated installation docs |
37 |
MEDIA_URL = '/static/' |
38 |
ADMIN_MEDIA_PREFIX = '/static/admin/' |
|
64
by Bruce Kroeze
changing settings around a bit to support testing |
39 |
BASE_SERVER="http://getbanjo.com" |
40 |
||
41 |
DATABASE_ENGINE = 'postgresql_psycopg2' |
|
42 |
DATABASE_NAME = 'banjo' |
|
43 |
DATABASE_USER = 'banjo' |
|
44 |
DATABASE_PASSWORD = 'password-here' |
|
45 |
DATABASE_HOST = '' |
|
46 |
DATABASE_PORT = '' |
|
47 |
||
48 |
EMAIL_HOST = 'getbanjo.com' |
|
49 |
EMAIL_HOST_USER="bruce" |
|
50 |
EMAIL_FROM = 'bruce@getbanjo.com' |
|
51 |
EMAIL_HOST_PASSWORD="email password" |
|
52 |
||
53 |
TEMPLATE_DIRS = ( |
|
54 |
r'/opt/webapps/banjo/templates', |
|
55 |
)
|
|
56 |
||
57 |
ACCOUNT_ACTIVATION_DAYS = 3 |
|
58 |
||
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
59 |
#CACHE_BACKEND = "file:///var/tmp/django_cache"
|
60 |
CACHE_BACKEND = "memcached://127.0.0.1:11211/" |
|
64
by Bruce Kroeze
changing settings around a bit to support testing |
61 |
CACHE_TIMEOUT = 60*5 |
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
62 |
CACHE_PREFIX = "BJ" |
64
by Bruce Kroeze
changing settings around a bit to support testing |
63 |
|
64 |
SESSION_COOKIE_NAME ='BANJO' |
|
65 |
||
66 |
ADMINS = ( |
|
67 |
('Your Name', 'name@getbanjo.com'), |
|
68 |
)
|
|
69 |
||
70 |
MANAGERS = ADMINS |
|
71 |
||
72 |
# Local time zone for this installation. All choices can be found here:
|
|
73 |
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
|
|
74 |
TIME_ZONE = 'America/Los_Angeles' |
|
75 |
||
76 |
# Language code for this installation. All choices can be found here:
|
|
77 |
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
|
|
78 |
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
|
|
79 |
LANGUAGE_CODE = 'en-us' |
|
80 |
||
81 |
DEFAULT_FROM_EMAIL = 'name@getbanjo.com' |
|
82 |
EMAIL_SUBJECT_PREFIX = "Banjo:" |
|
83 |
SERVER_MAIL="system@getbanjo.com" |
|
84 |
||
85 |
# List of callables that know how to import templates from various sources.
|
|
86 |
TEMPLATE_LOADERS = ( |
|
112
by Bruce Kroeze
Added multiblog capability and further refactored project layout by moving skins and threadlocals to common |
87 |
'banjo.common.skins.loader.load_template_source', |
64
by Bruce Kroeze
changing settings around a bit to support testing |
88 |
'django.template.loaders.filesystem.load_template_source', |
89 |
'django.template.loaders.app_directories.load_template_source', |
|
90 |
'django.template.loaders.eggs.load_template_source', |
|
91 |
)
|
|
92 |
||
93 |
MIDDLEWARE_CLASSES = ( |
|
94 |
"django.middleware.common.CommonMiddleware", |
|
95 |
"django.middleware.gzip.GZipMiddleware", |
|
96 |
"django.contrib.sessions.middleware.SessionMiddleware", |
|
97 |
"django.contrib.auth.middleware.AuthenticationMiddleware", |
|
98 |
"django.middleware.doc.XViewMiddleware", |
|
114
by Bruce Kroeze
making BlogMiddleware integral |
99 |
"banjo.blog.middleware.BlogMiddleware", |
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
100 |
"banjo.common.middleware.P3PMiddleware"
|
64
by Bruce Kroeze
changing settings around a bit to support testing |
101 |
)
|
102 |
||
135
by Bruce Kroeze
clean up of templates, reorganized removing duplicates |
103 |
# If you are using the P3PMiddleware above, you'll want to
|
90
by Bruce Kroeze
added p3p middleware |
104 |
# make a p3p.xml file, a policy file, and generate your own compact header.
|
105 |
||
64
by Bruce Kroeze
changing settings around a bit to support testing |
106 |
ROOT_URLCONF = 'banjo.urls' |
107 |
||
108 |
SESSION_EXPIRE_AT_BROWSER_CLOSE = False |
|
109 |
||
110 |
USE_ETAGS = True |
|
111 |
||
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
112 |
import banjo |
113 |
||
64
by Bruce Kroeze
changing settings around a bit to support testing |
114 |
INSTALLED_APPS = ( |
115 |
'django.contrib.admin', |
|
116 |
'django.contrib.auth', |
|
117 |
'django.contrib.contenttypes', |
|
118 |
'django.contrib.humanize', |
|
119 |
'django.contrib.sessions', |
|
120 |
'django.contrib.sites', |
|
163
by Bruce Kroeze
fixing comment posting |
121 |
) + banjo.BANJO_BASE_APPS + ( |
64
by Bruce Kroeze
changing settings around a bit to support testing |
122 |
'registration', |
171
by Bruce Kroeze
added typogrify |
123 |
'typogrify', |
124
by Bruce Kroeze
removing banjo_admin, moved this to a separate app, django_admin_plugins |
124 |
# all the following are optional
|
110
by Bruce Kroeze
added blogroll app |
125 |
'banjo.addons.blogroll', |
124
by Bruce Kroeze
removing banjo_admin, moved this to a separate app, django_admin_plugins |
126 |
'extensions', |
64
by Bruce Kroeze
changing settings around a bit to support testing |
127 |
)
|
128 |
||
135
by Bruce Kroeze
clean up of templates, reorganized removing duplicates |
129 |
# add the base skin directory
|
130 |
SKIN_DIRS = ( |
|
131 |
reduce(os.path.join, (os.path.dirname(banjo.__file__), "blog", "templates", "skins")), |
|
132 |
)
|
|
111
by Bruce Kroeze
refactoring modules, ensuring common naming and imports, renamed banjo.solid to banjo.common |
133 |
|
64
by Bruce Kroeze
changing settings around a bit to support testing |
134 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
135 |
"django.core.context_processors.auth", |
|
136 |
"django.core.context_processors.debug", |
|
137 |
"django.core.context_processors.i18n", |
|
138 |
'django.core.context_processors.request', |
|
135
by Bruce Kroeze
clean up of templates, reorganized removing duplicates |
139 |
) + banjo.BANJO_TEMPLATE_CONTEXT_PROCESSORS |
140 |
||
167
by Bruce Kroeze
fixing missing line in settings_customize |
141 |
from banjo.blog.syndication import XMLRPC_METHODS |