| 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 | |
|---|
| 18 | from os import path |
|---|
| 19 | |
|---|
| 20 | ugettext = lambda s: s # dummy ugettext function, as said on django docs |
|---|
| 21 | |
|---|
| 22 | MERENGUEDIR = 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) |
|---|
| 26 | PUBLIC_SERVER = None |
|---|
| 27 | |
|---|
| 28 | # List of callables that know how to import templates from various sources. |
|---|
| 29 | TEMPLATE_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 | |
|---|
| 38 | TEMPLATE_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 | |
|---|
| 49 | TEMPLATE_DIRS = ( |
|---|
| 50 | path.join(MERENGUEDIR, 'templates'), |
|---|
| 51 | ) |
|---|
| 52 | |
|---|
| 53 | # merengue specific installed apps. |
|---|
| 54 | MERENGUE_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 | |
|---|
| 76 | HTTP_STATUS_CODE_TEMPLATES = { |
|---|
| 77 | 403: '403.html', |
|---|
| 78 | 404: '404.html', |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | # Merengue installed apps |
|---|
| 82 | INSTALLED_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. |
|---|
| 121 | MERENGUE_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 | |
|---|
| 135 | PRE_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 | |
|---|
| 151 | POST_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 | |
|---|
| 160 | MIDDLEWARE_CLASSES = PRE_MERENGUE_MIDDLEWARE_CLASSES + MERENGUE_MIDDLEWARE_CLASSES + POST_MERENGUE_MIDDLEWARE_CLASSES |
|---|
| 161 | |
|---|
| 162 | # merengue status list for contents workflow. |
|---|
| 163 | STATUS_LIST = ( |
|---|
| 164 | ('draft', ugettext('Draft')), |
|---|
| 165 | ('pending', ugettext('Pending')), |
|---|
| 166 | ('published', ugettext('Published')), |
|---|
| 167 | ) |
|---|
| 168 | DEFAULT_STATUS = 'draft' |
|---|
| 169 | |
|---|
| 170 | # max integer value (database safe) |
|---|
| 171 | MAX_INT_VALUE = 2147483647 |
|---|
| 172 | |
|---|
| 173 | # merengue default directory for plugins |
|---|
| 174 | PLUGINS_DIR = 'plugins' |
|---|
| 175 | |
|---|
| 176 | # merengue required plugins in project (will be activated by default) |
|---|
| 177 | REQUIRED_PLUGINS = ('core', ) |
|---|
| 178 | |
|---|
| 179 | # if merengue will detect new plugins in file system |
|---|
| 180 | DETECT_NEW_PLUGINS = False |
|---|
| 181 | |
|---|
| 182 | # if merengue will detect broken plugins |
|---|
| 183 | DETECT_BROKEN_PLUGINS = True |
|---|
| 184 | |
|---|
| 185 | # The module to store session data |
|---|
| 186 | SESSION_ENGINE = 'merengue.backends.db' |
|---|
| 187 | |
|---|
| 188 | # Roles which may be acquired by an user when visiting a content inside a section |
|---|
| 189 | ACQUIRE_SECTION_ROLES = False |
|---|
| 190 | |
|---|
| 191 | # cache default settings |
|---|
| 192 | CACHE_MIDDLEWARE_SECONDS = 3600 * 24 |
|---|
| 193 | CACHE_MIDDLEWARE_KEY_PREFIX = 'merengue' |
|---|
| 194 | CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True |
|---|
| 195 | JOHNNY_MIDDLEWARE_KEY_PREFIX = 'merengue' |
|---|
| 196 | |
|---|
| 197 | CACHE_PERMISSIONS = True |
|---|
| 198 | CACHE_MAX_KEY = 250 |
|---|
| 199 | |
|---|
| 200 | # Google API Key for localhost:8000 |
|---|
| 201 | # http://code.google.com/apis/maps/signup.html |
|---|
| 202 | GOOGLE_MAPS_API_KEY = 'ABQIAAAAddxuy_lt2uAk9Y30XD3MJhQCULP4XOMyhPd8d_NrQQEO8sT8XBRRmJjQjU4qrycwOKb_v70y1h_1GQ' |
|---|
| 203 | GOOGLE_MAPS_API_VERSION = '3.x' |
|---|
| 204 | DEFAULT_LATITUDE = 36.851362 |
|---|
| 205 | DEFAULT_LONGITUDE = -5.753321 |
|---|
| 206 | |
|---|
| 207 | # Pagination options |
|---|
| 208 | PAGE_VARIABLE = 'page' |
|---|
| 209 | |
|---|
| 210 | # Default merengue options for tinyMCE |
|---|
| 211 | TINYMCE_LANG = 'en' |
|---|
| 212 | TINYMCE_LANG_SPELLCHECKER = '+English=en' |
|---|
| 213 | TINYMCE_MEDIA = None # set to something like: MEDIA_URL + "cmsutils/js/widgets/tiny_mce/" |
|---|
| 214 | EXTRA_MCE = { |
|---|
| 215 | 'theme_advanced_buttons1': 'bold,italic,copy,paste,pasteword,underline,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent', |
|---|
| 216 | } |
|---|
| 217 | |
|---|
| 218 | TINYMCE_EXTRA_MEDIA = { |
|---|
| 219 | 'js': [], |
|---|
| 220 | 'css': [], |
|---|
| 221 | } |
|---|
| 222 | |
|---|
| 223 | # Captcha default settings |
|---|
| 224 | CAPTCHA_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 |
|---|
| 236 | SUGGESTION_BOX_EMAIL = 'info@foo.com' |
|---|
| 237 | CONTACT_SUGGESTIONBOX_PREFIX = 'SUGGESTION BOX' |
|---|
| 238 | |
|---|
| 239 | # For transhette |
|---|
| 240 | ENABLE_TRANSLATION_SUGGESTIONS = False |
|---|
| 241 | |
|---|
| 242 | # Map parameters |
|---|
| 243 | MAP_FILTRABLE_MODELS = ( |
|---|
| 244 | 'base.basecontent', |
|---|
| 245 | ) |
|---|
| 246 | |
|---|
| 247 | |
|---|
| 248 | def show_debug_toolbar(request): |
|---|
| 249 | from django.conf import settings |
|---|
| 250 | return settings.DEBUG_TOOLBAR |
|---|
| 251 | |
|---|
| 252 | |
|---|
| 253 | DEBUG_TOOLBAR_EXCLUDED_URLS = ( |
|---|
| 254 | r'^/tinyimages/', |
|---|
| 255 | ) |
|---|
| 256 | |
|---|
| 257 | DEBUG_TOOLBAR_CONFIG = { |
|---|
| 258 | 'INTERCEPT_REDIRECTS': False, |
|---|
| 259 | 'SHOW_TOOLBAR_CALLBACK': show_debug_toolbar, |
|---|
| 260 | } |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | # ajax_select |
|---|
| 264 | AJAX_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 | |
|---|
| 273 | JQUERY_BASE_MEDIA = 'merengue/js/' |
|---|
| 274 | |
|---|
| 275 | # Customization Comment app for merengue, feedback |
|---|
| 276 | # COMMENTS_APP = 'plugins.feedback' |
|---|
| 277 | CONTENT_COMMENTABLE_BY_DEFAULT = 'allowed' |
|---|
| 278 | |
|---|
| 279 | MENU_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 | # ...} |
|---|
| 287 | SITE_FIXTURES = {} |
|---|
| 288 | |
|---|
| 289 | SERIALIZATION_MODULES = { |
|---|
| 290 | "xml": "merengue.xml_serializer", |
|---|
| 291 | } |
|---|
| 292 | |
|---|
| 293 | # Prefix for all project |
|---|
| 294 | BASE_URL = '/' |
|---|
| 295 | |
|---|
| 296 | # Prefix for all merengue URLs |
|---|
| 297 | MERENGUE_URLS_PREFIX = 'cms' |
|---|
| 298 | |
|---|
| 299 | # Login and logout settings |
|---|
| 300 | LOGIN_URL = '/%s/login/' % MERENGUE_URLS_PREFIX |
|---|
| 301 | LOGOUT_URL = '/%s/logout/' % MERENGUE_URLS_PREFIX |
|---|
| 302 | LOGIN_REDIRECT_URL = '/' |
|---|
| 303 | LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL |
|---|
| 304 | |
|---|
| 305 | # Test settings |
|---|
| 306 | TEST_RUNNER = 'merengue.test.run_tests' |
|---|
| 307 | APPS_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 |
|---|
| 322 | MANAGE_FILE = 'manage.py' |
|---|
| 323 | |
|---|
| 324 | # sys.executable |
|---|
| 325 | # /usr/bin/python |
|---|
| 326 | SYS_EXECUTABLE = None |
|---|
| 327 | |
|---|
| 328 | JOHNNY_TABLE_BLACKLIST = ('south_migrationhistory', 'django_content_type', 'thumbnail_kvstore', 'plugins_registeredplugin', ) |
|---|
| 329 | |
|---|
| 330 | # Path for translation catalogs search |
|---|
| 331 | LOCALE_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) |
|---|
| 336 | DEFAULT_THEME_PREVIEW = 'merengue/img/preview_merengue.png' |
|---|
| 337 | |
|---|
| 338 | STATIC_ROLES = [u'Anonymous User', u'Owner'] |
|---|
| 339 | |
|---|
| 340 | STATIC_WORKFLOW_DATA = { |
|---|
| 341 | 'states': [u'draft', u'published'], |
|---|
| 342 | 'transitions': [u'set-as-pending', u'publish', u'set-as-draft'], |
|---|
| 343 | } |
|---|
| 344 | |
|---|
| 345 | # inplaceeditform |
|---|
| 346 | ADAPTOR_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) |
|---|
| 350 | DEFAULT_PLUGIN_PREVIEW = path.join('merengue', 'img', 'preview_merengue.png') |
|---|
| 351 | |
|---|
| 352 | # Num element per page in collections |
|---|
| 353 | NUM_ELEM_PER_PAGE_DEFAULT = 10 |
|---|
| 354 | |
|---|
| 355 | # Search in genericforeingkey model admins |
|---|
| 356 | SEARCH_MODELADMIN = True |
|---|
| 357 | |
|---|
| 358 | # Settings to autoreports |
|---|
| 359 | AUTOREPORTS_FUNCTIONS = True |
|---|
| 360 | AUTOREPORTS_INITIAL = True |
|---|
| 361 | AUTOREPORTS_I18N = True |
|---|
| 362 | AUTOREPORTS_SUBFIX = True |
|---|
| 363 | |
|---|
| 364 | # Default workflow |
|---|
| 365 | DEFAULT_WORKFLOW = 1 |
|---|
| 366 | |
|---|
| 367 | # Reviewers fetching function |
|---|
| 368 | REVIEWERS_EXTRACTOR = 'merengue.review.get_publishers' |
|---|
| 369 | |
|---|
| 370 | # Portal link categories |
|---|
| 371 | PORTAL_LINK_CATEGORIES = ( |
|---|
| 372 | ('primary', ugettext('Primary link')), |
|---|
| 373 | ('secondary', ugettext('Secondary link')), |
|---|
| 374 | ) |
|---|
| 375 | |
|---|
| 376 | PORTAL_LINK_POSITIONS = { |
|---|
| 377 | 'primary': 'header', |
|---|
| 378 | 'secondary': 'header', |
|---|
| 379 | } |
|---|
| 380 | |
|---|
| 381 | # sitemap |
|---|
| 382 | SMAP_EXCLUDE_CLASS_NAME = ('collection', 'feedcollection', 'feeditem') |
|---|
| 383 | |
|---|
| 384 | # Access request 403 |
|---|
| 385 | ACCESS_REQUEST_REDIRECT = LOGIN_REDIRECT_URL |
|---|