1 2 3 4 5 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 35 36 37 38 41 42 44 45 46 48 49 50 53 54 55 56 57 58 61 62 63 64 65 66 67 69 70 71 72 74 75 76 77 78 79 80 81 82 83 85 86 87 88 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 113 114 116 117 118 120 121 122 124 125 126 127 129 130 131 132 133 135 136 139 140 142 143 144 145 146 148 149 150 151 152 154 155 156 157 158 159 160 161 162 163 164 165 167 168 169 170 172 173 174 176 177 178 |
# -*- coding: utf-8 -*- # Convenience module that provides access to custom settings for the # ``pages`` application. Provides default settings for the ``pages`` # application when the project ``settings`` module does not contain # the appropriate settings.
# The path to default template raise ImproperlyConfigured('Please make sure you specified a ' 'DEFAULT_PAGE_TEMPLATE setting.')
# PAGE_TEMPLATES is a list of tuples that specifies the which templates # are available in the ``pages`` admin. Templates should be assigned in # the following format: # # PAGE_TEMPLATES = ( # ('pages/nice.html', 'nice one'), # ('pages/cool.html', 'cool one'), # ) # # One can also assign a callable (which should return the tuple) to this # variable to achieve dynamic template list e.g.: # # def _get_templates(): # ... # # PAGE_TEMPLATES = _get_templates
not (isinstance(PAGE_TEMPLATES, str) or isinstance(PAGE_TEMPLATES, unicode))): PAGE_TEMPLATES = ()
return PAGE_TEMPLATES() else:
# Set ``PAGE_PERMISSION`` to ``False`` if you do not wish to enable # advanced hierarchic permissions on your pages.
# Set ``PAGE_TAGGING`` to ``False`` if you do not wish to use the # ``django-tagging`` application. raise ImproperlyConfigured('django-tagging could not be found.\n' 'Please make sure you\'ve installed it ' 'correctly or disable the tagging feature by ' 'setting PAGE_TAGGING to False.')
# Set this to ``True`` if you wish to use the ``django-tinymce`` application. raise ImproperlyConfigured('django-tinymce could not be found.\n' 'Please make sure you\'ve installed it ' 'correctly or disable the tinymce feature by ' 'setting PAGE_TINYMCE to False.')
# Set ``PAGE_UNIQUE_SLUG_REQUIRED`` to ``True`` to enforce unique slug names # for all pages. False)
# Set ``PAGE_CONTENT_REVISION`` to ``False`` to disable the recording of # pages revision information in the database
# A list tuples that defines the languages that pages can be translated into. # # gettext_noop = lambda s: s # # PAGE_LANGUAGES = ( # ('zh-cn', gettext_noop('Chinese Simplified')), # ('fr-ch', gettext_noop('Swiss french')), # ('en-us', gettext_noop('US English')), #)
# Defines which language should be used by default. If # ``PAGE_DEFAULT_LANGUAGE`` not specified, then project's # ``settings.LANGUAGE_CODE`` is used settings.LANGUAGE_CODE)
# PAGE_LANGUAGE_MAPPING should be assigned a function that takes a single # argument, the language code of the incoming browser request. This function # maps the incoming client language code to another language code, presumably # one for which you have translation strings. This is most useful if your # project only has one set of translation strings for a language like Chinese, # which has several variants like ``zh-cn``, ``zh-tw``, ``zh-hk`, etc., but # you want to provide your Chinese translations to all Chinese browsers, not # just those with the exact ``zh-cn`` # locale. # # Enable that behavior here by assigning the following function to the # PAGE_LANGUAGE_MAPPING variable. # # def language_mapping(lang): # if lang.startswith('zh'): # return 'zh-cn' # return lang # PAGE_LANGUAGE_MAPPING = language_mapping
# Set SITE_ID to the id of the default ``Site`` instance to be used on # installations where content from a single installation is servedĀ on # multiple domains via the ``django.contrib.sites`` framework.
# Set PAGE_USE_SITE_ID to ``True`` to make use of the ``django.contrib.sites`` # framework
# Set PAGE_USE_LANGUAGE_PREFIX to ``True`` to make the ``get_absolute_url`` # method to prefix the URLs with the language code False)
# Assign a list of placeholders to PAGE_CONTENT_REVISION_EXCLUDE_LIST # to exclude them from the revision process. 'PAGE_CONTENT_REVISION_EXCLUDE_LIST', () )
# Set ``PAGE_SANITIZE_USER_INPUT`` to ``True`` to sanitize the user input with # ``html5lib``
# URL that handles pages media and uses <MEDIA_ROOT>/pages by default.
# Hide the slug's of the first root page ie: ``/home/`` becomes ``/``
# Show the publication start date field in the admin. Allows for future dating # Changing the ``PAGE_SHOW_START_DATE`` from ``True`` to ``False`` # after adding data could cause some weirdness. If you must do this, you # should update your database to correct any future dated pages.
# Show the publication end date field in the admin, allows for page expiration # Changing ``PAGE_SHOW_END_DATE`` from ``True`` to ``False`` after adding # data could cause some weirdness. If you must do this, you should update # your database and null any pages with ``publication_end_date`` set.
# ``PAGE_CONNECTED_MODELS`` allows you to specify a model and form for this # model into your settings to get an automatic form to create # and directly link a new instance of this model with your page in the admin. # # Here is an example: # # PAGE_CONNECTED_MODELS = [ # {'model':'documents.models.Document', # 'form':'documents.models.DocumentForm'}, # ] #
# The page link filter enable a output filter on you content links. The goal # is to transform special page class into real links at the last moment. # This ensure that even if you have moved a page, the URL will remain correct.
# This setting is a function that can be defined if you need to pass extra # context data to the pages templates.
# This setting is the name of a sub-folder where uploaded content, like # placeholder images, is placed. |