source: trunk/merengueproj/merengue/settings.py @ 5579

Revision 5579, 11.0 KB checked in by esanchez, 3 weeks ago (diff)

Allow to change the default commentable value. Fixes #2317

  • Property pyflakes:ignore set to true
  • Property pyflakes:ignoretrue set to true
Line 
1# Copyright (c) 2010 by Yaco Sistemas
2#
3# This file is part of Merengue.
4#
5# Merengue is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# Merengue is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with Merengue.  If not, see <http://www.gnu.org/licenses/>.
17
18from os import path
19
20ugettext = lambda s: s  # dummy ugettext function, as said on django docs
21
22MERENGUEDIR = path.dirname(path.abspath(__file__))
23
24#This line is usefull when you copy your server data base for develop in your
25#local machine but you do not copy all content images (used in DEBUG mode only)
26PUBLIC_SERVER = None
27
28# List  of  callables that know how to import templates from various sources.
29TEMPLATE_LOADERS = (
30    #('django.template.loaders.cached.Loader', (
31        'merengue.theming.loader.load_template_source',  # for enabling theme support in Merengue
32        'django.template.loaders.filesystem.load_template_source',
33        'django.template.loaders.app_directories.load_template_source',
34        'django.template.loaders.eggs.load_template_source',
35    #)),
36)
37
38TEMPLATE_CONTEXT_PROCESSORS = (
39    'django.contrib.auth.context_processors.auth',
40    'django.core.context_processors.debug',
41    'django.core.context_processors.i18n',
42    'django.core.context_processors.media',
43    'django.core.context_processors.request',
44    'merengue.context_processors.all_context',
45    'merengue.theming.context_processors.media',
46    'merengue.section.context_processors.section',
47)
48
49TEMPLATE_DIRS = (
50    path.join(MERENGUEDIR, 'templates'),
51)
52
53# merengue specific installed apps.
54MERENGUE_APPS = (
55    'merengue.registry',
56    'merengue.pluggable',
57    'merengue.multimedia',
58    'merengue.perms',
59    'merengue.workflow',
60    'merengue.base',
61    'merengue.section',
62    'merengue.theming',
63    'merengue.action',
64    'merengue.block',
65    'merengue.viewlet',
66    'merengue.portal',
67    'merengue.internallinks',
68    'merengue.collection',
69    'merengue.review',
70    'merengue.uitools',
71    'merengue.cache',
72    'merengue.seo',
73    'merengue.collab',  # Please, keep this application in last place cause it's used to know when activate plugins after migration
74)
75
76HTTP_STATUS_CODE_TEMPLATES = {
77    403: '403.html',
78    404: '404.html',
79}
80
81# Merengue installed apps
82INSTALLED_APPS = (
83    'django.contrib.auth',
84    'django.contrib.contenttypes',
85    'django.contrib.sessions',
86    'django.contrib.sites',
87    'django.contrib.admin',
88    #'django.contrib.comments',
89    'django_extensions',
90    'template_utils',
91    'debug_toolbar',
92    'cmsutils',
93    'transmeta',
94    'transhette',
95    'tagging',
96    'sorl.thumbnail',
97    'pagination',
98    'inplaceeditform',
99    'searchform',
100    'inlinetrans',
101    'mptt',
102    'tinyimages',
103    'rating',
104    'captcha',
105    'south',
106    'threadedcomments',
107    'autoreports',
108    'formadmin',
109    'johnny',
110    'oot',
111    'genericforeignkey',
112    'oembed',
113    'ajax_select',
114    'notification',
115    'compressor',
116    'announcements',
117    'django_su',
118) + MERENGUE_APPS
119
120# Merengue specific middlewares.
121MERENGUE_MIDDLEWARE_CLASSES = (
122    'merengue.middleware.RemoveRandomAjaxParameter',
123    'merengue.section.middleware.RequestSectionMiddleware',
124    'merengue.section.middleware.DebugSectionMiddleware',
125    'merengue.multimedia.middleware.MediaMiddleware',
126    'merengue.middleware.SimplifiedLayoutMiddleware',
127    'merengue.middleware.LocaleMiddleware',
128    'merengue.middleware.HttpStatusCodeRendererMiddleware',
129    'merengue.pluggable.middleware.ActivePluginsMiddleware',
130    'django.middleware.csrf.CsrfResponseMiddleware',
131)
132
133# merengue usual middleware list. you can use this variable in your MIDDLEWARE_CLASSES project settings
134
135PRE_MERENGUE_MIDDLEWARE_CLASSES = (
136    'johnny.middleware.LocalStoreClearMiddleware',  # this has to be first
137    'merengue.cache.middleware.UpdateAnonymousCacheMiddleware',
138    'merengue.cache.middleware.CheckMemoizeCaches',
139    #'cmsutils.middleware.ProfileMiddleware',  # remove comment if you want to profile your website
140    'johnny.middleware.QueryCacheMiddleware',
141    'django.middleware.common.CommonMiddleware',
142    'django.contrib.sessions.middleware.SessionMiddleware',
143    'django.contrib.auth.middleware.AuthenticationMiddleware',
144    'django.middleware.transaction.TransactionMiddleware',
145    'pagination.middleware.PaginationMiddleware',
146    'django.middleware.locale.LocaleMiddleware',
147    'cmsutils.middleware.AutomatizedTestingMiddleware',
148    'django.contrib.messages.middleware.MessageMiddleware',
149)
150
151POST_MERENGUE_MIDDLEWARE_CLASSES = (
152    #'django.middleware.gzip.GZipMiddleware',
153    'merengue.section.middleware.ResponseSectionMiddleware',
154    'merengue.pluggable.middleware.PluginMiddlewaresProxy',
155    'merengue.block.middleware.RenderBlockMiddleware',
156    'merengue.cache.middleware.FetchFromAnonymousCacheMiddleware',
157    'debug_toolbar.middleware.DebugToolbarMiddleware',
158)
159
160MIDDLEWARE_CLASSES = PRE_MERENGUE_MIDDLEWARE_CLASSES + MERENGUE_MIDDLEWARE_CLASSES + POST_MERENGUE_MIDDLEWARE_CLASSES
161
162# merengue status list for contents workflow.
163STATUS_LIST = (
164    ('draft', ugettext('Draft')),
165    ('pending', ugettext('Pending')),
166    ('published', ugettext('Published')),
167)
168DEFAULT_STATUS = 'draft'
169
170# max integer value (database safe)
171MAX_INT_VALUE = 2147483647
172
173# merengue default directory for plugins
174PLUGINS_DIR = 'plugins'
175
176# merengue required plugins in project (will be activated by default)
177REQUIRED_PLUGINS = ('core', )
178
179# if merengue will detect new plugins in file system
180DETECT_NEW_PLUGINS = False
181
182# if merengue will detect broken plugins
183DETECT_BROKEN_PLUGINS = True
184
185# The module to store session data
186SESSION_ENGINE = 'merengue.backends.db'
187
188# Roles which may be acquired by an user when visiting a content inside a section
189ACQUIRE_SECTION_ROLES = False
190
191# cache default settings
192CACHE_MIDDLEWARE_SECONDS = 3600 * 24
193CACHE_MIDDLEWARE_KEY_PREFIX = 'merengue'
194CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
195JOHNNY_MIDDLEWARE_KEY_PREFIX = 'merengue'
196
197CACHE_PERMISSIONS = True
198CACHE_MAX_KEY = 250
199
200# Google API Key for localhost:8000
201# http://code.google.com/apis/maps/signup.html
202GOOGLE_MAPS_API_KEY = 'ABQIAAAAddxuy_lt2uAk9Y30XD3MJhQCULP4XOMyhPd8d_NrQQEO8sT8XBRRmJjQjU4qrycwOKb_v70y1h_1GQ'
203GOOGLE_MAPS_API_VERSION = '3.x'
204DEFAULT_LATITUDE = 36.851362
205DEFAULT_LONGITUDE = -5.753321
206
207# Pagination options
208PAGE_VARIABLE = 'page'
209
210# Default merengue options for tinyMCE
211TINYMCE_LANG = 'en'
212TINYMCE_LANG_SPELLCHECKER = '+English=en'
213TINYMCE_MEDIA = None  # set to something like: MEDIA_URL + "cmsutils/js/widgets/tiny_mce/"
214EXTRA_MCE = {
215    'theme_advanced_buttons1': 'bold,italic,copy,paste,pasteword,underline,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent',
216}
217
218TINYMCE_EXTRA_MEDIA = {
219   'js': [],
220   'css': [],
221}
222
223# Captcha default settings
224CAPTCHA_SETTINGS = {
225    'NUMBER_SWAP': {
226                    'O': '0',
227                    'Z': '2',
228                    'S': '5',
229                    'B': '8',
230    },
231    'CASE_SENSITIVE': False,
232    'USE_EXTRA_IMAGE': False,
233}
234
235# Default parameters for suggestion box
236SUGGESTION_BOX_EMAIL = 'info@foo.com'
237CONTACT_SUGGESTIONBOX_PREFIX = 'SUGGESTION BOX'
238
239# For transhette
240ENABLE_TRANSLATION_SUGGESTIONS = False
241
242# Map parameters
243MAP_FILTRABLE_MODELS = (
244    'base.basecontent',
245)
246
247
248def show_debug_toolbar(request):
249    from django.conf import settings
250    return settings.DEBUG_TOOLBAR
251
252
253DEBUG_TOOLBAR_EXCLUDED_URLS = (
254    r'^/tinyimages/',
255)
256
257DEBUG_TOOLBAR_CONFIG = {
258    'INTERCEPT_REDIRECTS': False,
259    'SHOW_TOOLBAR_CALLBACK': show_debug_toolbar,
260}
261
262
263# ajax_select
264AJAX_LOOKUP_CHANNELS = {
265    'perms_user': ('merengue.perms.lookups', 'UserLookup'),
266    'perms_group': ('merengue.perms.lookups', 'GroupLookup'),
267    'base_content': ('merengue.base.lookups', 'ContentLookup'),
268    'user': ('merengue.base.lookups', 'UserLookup'),
269    'django_su': ('merengue.base.lookups', 'UserLookup'),
270    'section_contentlink': ('merengue.section.lookups', 'ContentLinkLookup'),
271}
272
273JQUERY_BASE_MEDIA = 'merengue/js/'
274
275# Customization Comment app for merengue, feedback
276# COMMENTS_APP = 'plugins.feedback'
277CONTENT_COMMENTABLE_BY_DEFAULT = 'allowed'
278
279MENU_PORTAL_SLUG = 'portal_menu'
280
281# Dictionary with fixtures to load for every application
282# After migrating (with south) 'foo' application Merengue will load
283# every SITE_FIXTURES['foo'] files
284# Syntax: {
285#    'app_name': ('fixture_to_load1', 'fixture_to_load2', ...),
286#    ...}
287SITE_FIXTURES = {}
288
289SERIALIZATION_MODULES = {
290    "xml": "merengue.xml_serializer",
291}
292
293# Prefix for all project
294BASE_URL = '/'
295
296# Prefix for all merengue URLs
297MERENGUE_URLS_PREFIX = 'cms'
298
299# Login and logout settings
300LOGIN_URL = '/%s/login/' % MERENGUE_URLS_PREFIX
301LOGOUT_URL = '/%s/logout/' % MERENGUE_URLS_PREFIX
302LOGIN_REDIRECT_URL = '/'
303LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL
304
305# Test settings
306TEST_RUNNER = 'merengue.test.run_tests'
307APPS_TO_TEST = (
308    'action',
309    'block',
310    'registry',
311    'perms',
312    'portal',
313    'pluggable',
314    'section',
315    'theming',
316    'viewlet',
317    'workflow',
318    'base',
319)
320
321# Merengue manage file
322MANAGE_FILE = 'manage.py'
323
324# sys.executable
325# /usr/bin/python
326SYS_EXECUTABLE = None
327
328JOHNNY_TABLE_BLACKLIST = ('south_migrationhistory', 'django_content_type', 'thumbnail_kvstore', 'plugins_registeredplugin', )
329
330# Path for translation catalogs search
331LOCALE_PATHS = (
332    path.join(MERENGUEDIR, 'locale'),
333)
334
335# Theme default preview image. The real path would be path.join(MEDIA_URL, DEFAULT_PLUGIN_PREVIEW)
336DEFAULT_THEME_PREVIEW = 'merengue/img/preview_merengue.png'
337
338STATIC_ROLES = [u'Anonymous User', u'Owner']
339
340STATIC_WORKFLOW_DATA = {
341    'states': [u'draft', u'published'],
342    'transitions': [u'set-as-pending', u'publish', u'set-as-draft'],
343}
344
345# inplaceeditform
346ADAPTOR_INPLACEEDIT = {'textarea': 'merengue.uitools.fields.AdaptorTinyMCEField',
347                       'image': 'merengue.uitools.fields.AdaptorImageThumbnailField'}
348
349# Plugin default preview image. The real path would be path.join(MEDIA_URL, DEFAULT_PLUGIN_PREVIEW)
350DEFAULT_PLUGIN_PREVIEW = path.join('merengue', 'img', 'preview_merengue.png')
351
352# Num element per page in collections
353NUM_ELEM_PER_PAGE_DEFAULT = 10
354
355# Search in genericforeingkey model admins
356SEARCH_MODELADMIN = True
357
358# Settings to autoreports
359AUTOREPORTS_FUNCTIONS = True
360AUTOREPORTS_INITIAL = True
361AUTOREPORTS_I18N = True
362AUTOREPORTS_SUBFIX = True
363
364# Default workflow
365DEFAULT_WORKFLOW = 1
366
367# Reviewers fetching function
368REVIEWERS_EXTRACTOR = 'merengue.review.get_publishers'
369
370# Portal link categories
371PORTAL_LINK_CATEGORIES = (
372    ('primary', ugettext('Primary link')),
373    ('secondary', ugettext('Secondary link')),
374)
375
376PORTAL_LINK_POSITIONS = {
377    'primary': 'header',
378    'secondary': 'header',
379}
380
381# sitemap
382SMAP_EXCLUDE_CLASS_NAME = ('collection', 'feedcollection', 'feeditem')
383
384# Access request 403
385ACCESS_REQUEST_REDIRECT = LOGIN_REDIRECT_URL
Note: See TracBrowser for help on using the repository browser.