-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathdefault_settings.py
More file actions
145 lines (119 loc) · 6.02 KB
/
default_settings.py
File metadata and controls
145 lines (119 loc) · 6.02 KB
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
142
143
144
145
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
"""
Default settings for FeinCMS
All of these can be overridden by specifying them in the standard
``settings.py`` file.
"""
from django.conf import settings
# e.g. 'uploads' if you would prefer <media root>/uploads/imagecontent/test.jpg
# to <media root>/imagecontent/test.jpg.
FEINCMS_UPLOAD_PREFIX = getattr(settings, "FEINCMS_UPLOAD_PREFIX", "")
# ------------------------------------------------------------------------
# Settings for MediaLibrary
#: Local path to newly uploaded media files
FEINCMS_MEDIALIBRARY_UPLOAD_TO = getattr(
settings, "FEINCMS_MEDIALIBRARY_UPLOAD_TO", "medialibrary/%Y/%m/"
)
#: Thumbnail function for suitable mediafiles. Only receives the media file
#: and should return a thumbnail URL (or nothing).
FEINCMS_MEDIALIBRARY_THUMBNAIL = getattr(
settings,
"FEINCMS_MEDIALIBRARY_THUMBNAIL",
"feincms.module.medialibrary.thumbnail.default_admin_thumbnail",
)
# ------------------------------------------------------------------------
# Settings for RichText
FEINCMS_RICHTEXT_INIT_TEMPLATE = getattr(
settings,
"FEINCMS_RICHTEXT_INIT_TEMPLATE",
"admin/content/richtext/init_tinymce4.html",
)
FEINCMS_RICHTEXT_INIT_CONTEXT = getattr(
settings,
"FEINCMS_RICHTEXT_INIT_CONTEXT",
{
"TINYMCE_JS_URL": "https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js", # noqa
"TINYMCE_DOMAIN": None,
"TINYMCE_CONTENT_CSS_URL": None,
"TINYMCE_LINK_LIST_URL": None,
},
)
# ------------------------------------------------------------------------
# Settings for the page module
#: Include ancestors in filtered tree editor lists
FEINCMS_TREE_EDITOR_INCLUDE_ANCESTORS = getattr(
settings, "FEINCMS_TREE_EDITOR_INCLUDE_ANCESTORS", False
)
#: Enable checking of object level permissions. Note that if this option is
#: enabled, you must plug in an authentication backend that actually does
#: implement object level permissions or no page will be editable.
FEINCMS_TREE_EDITOR_OBJECT_PERMISSIONS = getattr(
settings, "FEINCMS_TREE_EDITOR_OBJECT_PERMISSIONS", False
)
#: When enabled, the page module is automatically registered with Django's
#: default admin site (this is activated by default).
FEINCMS_USE_PAGE_ADMIN = getattr(settings, "FEINCMS_USE_PAGE_ADMIN", True)
#: app_label.model_name as per apps.get_model.
#: defaults to page.Page
FEINCMS_DEFAULT_PAGE_MODEL = getattr(
settings, "FEINCMS_DEFAULT_PAGE_MODEL", "page.Page"
)
# ------------------------------------------------------------------------
#: Allow random gunk after a valid page?
FEINCMS_ALLOW_EXTRA_PATH = getattr(settings, "FEINCMS_ALLOW_EXTRA_PATH", False)
# ------------------------------------------------------------------------
#: How to switch languages.
#: * ``'STANDARD'``: The page a user navigates to sets the site's language
#: and overwrites whatever was set before.
#: * ``'EXPLICIT'``: The language set has priority, may only be overridden
#: by explicitely a language with ``?set_language=xx``.
FEINCMS_TRANSLATION_POLICY = getattr(settings, "FEINCMS_TRANSLATION_POLICY", "STANDARD")
# ------------------------------------------------------------------------
#: Makes the page handling mechanism try to find a cms page with that
#: path if it encounters a page not found situation. This allows for nice
#: customised cms-styled error pages. Do not go overboard, this should
#: be as simple and as error resistant as possible, so refrain from
#: deeply nested error pages or advanced content types.
FEINCMS_CMS_404_PAGE = getattr(settings, "FEINCMS_CMS_404_PAGE", None)
# ------------------------------------------------------------------------
#: When uploading files to the media library, replacing an existing entry,
#: try to save the new file under the old file name in order to keep the
#: media file path (and thus the media url) constant.
#: Experimental, this might not work with all storage backends.
FEINCMS_MEDIAFILE_OVERWRITE = getattr(settings, "FEINCMS_MEDIAFILE_OVERWRITE", False)
# ------------------------------------------------------------------------
#: Prefix for thumbnails. Set this to something non-empty to separate thumbs
#: from uploads. The value should end with a slash, but this is not enforced.
FEINCMS_THUMBNAIL_DIR = getattr(settings, "FEINCMS_THUMBNAIL_DIR", "_thumbs/")
# ------------------------------------------------------------------------
#: feincms_thumbnail template filter library cache timeout. The default is to
#: not cache anything for backwards compatibility.
FEINCMS_THUMBNAIL_CACHE_TIMEOUT = getattr(
settings, "FEINCMS_THUMBNAIL_CACHE_TIMEOUT", 0
)
# ------------------------------------------------------------------------
#: Prevent changing template within admin for pages which have been
#: allocated a Template with singleton=True -- template field will become
#: read-only for singleton pages.
FEINCMS_SINGLETON_TEMPLATE_CHANGE_ALLOWED = getattr(
settings, "FEINCMS_SINGLETON_TEMPLATE_CHANGE_ALLOWED", False
)
#: Prevent admin page deletion for pages which have been allocated a
#: Template with singleton=True
FEINCMS_SINGLETON_TEMPLATE_DELETION_ALLOWED = getattr(
settings, "FEINCMS_SINGLETON_TEMPLATE_DELETION_ALLOWED", False
)
# ------------------------------------------------------------------------
#: Filter languages available for front end users to this set. This allows
#: to have languages not yet ready for prime time while being able to access
#: those pages in the admin backend.
FEINCMS_FRONTEND_LANGUAGES = getattr(settings, "FEINCMS_FRONTEND_LANGUAGES", None)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
#: Attempt to get translations of MediaFile objects. If `False`, FeinCMS will
#: instead just output the file name.
FEINCMS_MEDIAFILE_TRANSLATIONS = getattr(
settings, "FEINCMS_MEDIAFILE_TRANSLATIONS", True
)
# ------------------------------------------------------------------------