Settings

The following settings are available for configuration through your project. All settings are customized by prefixing WIKI_, so for instance URL_CASE_SENSITIVE should be configured as WIKI_URL_CASE_SENSITIVE. For plugins the prefix is WIKI_PLUGINNAME_, e.g. WIKI_IMAGES for the images plugin.

wiki.conf.settings.ACCOUNT_HANDLING = True

Sign up, login and logout views should be accessible.

wiki.conf.settings.ACCOUNT_SIGNUP_ALLOWED = True

Signup allowed? If it’s not allowed, logged in superusers can still access the signup page to create new users.

wiki.conf.settings.ANONYMOUS = True

Treat anonymous (i.e. non logged in) users as the “other” user group.

wiki.conf.settings.ANONYMOUS_CREATE = False

Globally enable create access for anonymous users. Defaults to ANONYMOUS_WRITE.

wiki.conf.settings.ANONYMOUS_UPLOAD = False

Default setting to allow anonymous users upload access. Used in plugins.attachments and plugins.images, and can be overwritten in these plugins.

wiki.conf.settings.ANONYMOUS_WRITE = True

Globally enable write access for anonymous users, if true anonymous users will be treated as the others_write boolean field on models.Article.

wiki.conf.settings.CACHE_TIMEOUT = 600

Seconds of timeout before renewing the article cache. Articles are automatically renewed whenever an edit occurs but article content may be generated from other objects that are changed.

wiki.conf.settings.CAN_ADMIN = None

A function returning True/False if a user has permission to create new groups and users for the wiki.

wiki.conf.settings.CAN_ASSIGN = None

A function returning True/False if a user has permission to assign permissions on an article. Relevance: Changing owner and group membership.

wiki.conf.settings.CAN_ASSIGN_OWNER = None

A function returning True/False if the owner of an article has permission to change the group to a user’s own groups. Relevance: Changing group membership.

wiki.conf.settings.CAN_CHANGE_PERMISSIONS = None

A function returning True/False if a user has permission to change read/write access for groups and others.

wiki.conf.settings.CAN_DELETE = None

Specifies if a user has access to soft deletion of articles.

wiki.conf.settings.CAN_MODERATE = None

A function returning True/False if a user has permission to change moderate, ie. lock articles and permanently delete content.

wiki.conf.settings.CAN_READ = None

A function returning True/False if a user has permission to read contents of an article and plugins. Relevance: Viewing articles and plugins.

wiki.conf.settings.CAN_WRITE = None

A function returning True/False if a user has permission to change contents, i.e. add new revisions to an article. Often, plugins also use this. Relevance: Editing articles, changing revisions, editing plugins.

wiki.conf.settings.CHECK_SLUG_URL_AVAILABLE = True

When True, this blocks new slugs that resolve to non-wiki views, stopping users creating articles that conflict with overlapping URLs from other apps.

wiki.conf.settings.EDITOR = u'wiki.editors.markitup.MarkItUp'

The editor class to use – maybe a 3rd party or your own...? You can always extend the built-in editor and customize it!

wiki.conf.settings.GROUP_MODEL = u'auth.Group'

Choose the Group model to use for permission handling. Defaults to django’s auth.Group.

wiki.conf.settings.LOG_IPS_ANONYMOUS = True

Do we want to log IPs of anonymous users?

wiki.conf.settings.LOG_IPS_USERS = False

Do we want to log IPs of logged in users?

wiki.conf.settings.LOST_AND_FOUND_SLUG = u'lost-and-found'

This slug is used in URLPath if an article has been deleted. The children of the URLPath of that article are moved to lost and found. They keep their permissions and all their content.

wiki.conf.settings.MARKDOWN_HTML_ATTRIBUTES = {u'em': [u'class', u'id'], u'pre': [u'class', u'id'], u'code': [u'class', u'id'], u'figure': [u'class', u'id'], u'h2': [u'class', u'id'], u'h3': [u'class', u'id'], u'h0': [u'class', u'id'], u'h1': [u'class', u'id'], u'h6': [u'class', u'id'], u'h7': [u'class', u'id'], u'h4': [u'class', u'id'], u'h5': [u'class', u'id'], u'table': [u'class', u'id'], u'span': [u'class', u'id'], u'img': [u'class', u'id', u'src', u'alt'], u'ul': [u'class', u'id'], u'tr': [u'class', u'id'], u'tbody': [u'class', u'id'], u'li': [u'class', u'id'], u'hr': [u'class', u'id'], u'th': [u'class', u'id'], u'td': [u'class', u'id'], u'thead': [u'class', u'id'], u'dl': [u'class', u'id'], u'blockquote': [u'class', u'id'], u'acronym': [u'title', u'class', u'id'], u'dd': [u'class', u'id'], u'figcaption': [u'class', u'id'], u'ol': [u'class', u'id'], u'abbr': [u'title', u'class', u'id'], u'br': [u'class', u'id'], u'dt': [u'class', u'id'], u'strong': [u'class', u'id'], u'a': [u'href', u'title', u'class', u'id'], u'b': [u'class', u'id'], u'i': [u'class', u'id'], u'p': [u'class', u'id'], u'div': [u'class', u'id']}

Dictionary of allowed attributes in Markdown article contents.

wiki.conf.settings.MARKDOWN_HTML_STYLES = []

Allowed inline styles in Markdown article contents, default is no styles (empty list).

wiki.conf.settings.MARKDOWN_HTML_WHITELIST = [u'a', u'abbr', u'acronym', u'b', u'blockquote', u'code', u'em', u'i', u'li', u'ol', u'strong', u'ul', u'figure', u'figcaption', u'br', u'hr', u'p', u'div', u'img', u'pre', u'span', u'table', u'thead', u'tbody', u'th', u'tr', u'td', u'dl', u'dt', u'dd', u'h0', u'h1', u'h2', u'h3', u'h4', u'h5', u'h6', u'h7']

List of allowed tags in Markdown article contents.

wiki.conf.settings.MARKDOWN_KWARGS = {u'extension_configs': {u'toc': {u'title': <django.utils.functional.__proxy__ object>}}, u'extensions': [u'footnotes', u'attr_list', u'smart_strong', u'footnotes', u'attr_list', u'def_list', u'tables', u'abbr', u'sane_lists']}

Arguments for the Markdown instance, for instance a list of extensions to use. See: https://pythonhosted.org/Markdown/extensions/index.html

To set a custom title for TOC’s:

WIKI_MARKDOWN_KWARGS = {'extension_configs': {'toc': _('Contents of this article')}}
wiki.conf.settings.MARKDOWN_SANITIZE_HTML = True

Whether to use Bleach or not. It’s not recommended to turn this off unless you know what you’re doing and you don’t want to use the other options.

wiki.conf.settings.MESSAGE_TAG_CSS_CLASS = {'debug': u'alert alert-info', 'info': u'alert alert-info', 'warning': u'alert alert-warning', 'success': u'alert alert-success', 'error': u'alert alert-danger'}

Mapping from message.tag to bootstrap class names.

wiki.conf.settings.REVISIONS_MINUTES_LOOKBACK = 2

Number of minutes to look back for looking up REVISIONS_PER_MINUTES and REVISIONS_PER_MINUTES_ANONYMOUS.

wiki.conf.settings.REVISIONS_PER_HOUR = 60

Maximum allowed revisions per hour for any given user or IP.

wiki.conf.settings.REVISIONS_PER_HOUR_ANONYMOUS = 10

Maximum allowed revisions per hour for any anonymous user and any IP.

wiki.conf.settings.REVISIONS_PER_MINUTES = 5

Maximum allowed revisions per minute for any given user or IP.

wiki.conf.settings.REVISIONS_PER_MINUTES_ANONYMOUS = 2

Maximum allowed revisions per minute for any anonymous user and any IP.

wiki.conf.settings.SEARCH_VIEW = u'wiki.views.article.SearchView'

Search view - dotted path denoting where the search view Class is located.

wiki.conf.settings.SHOW_MAX_CHILDREN = 20

Maximum amount of children to display in a menu before showing “+more”. NEVER set this to 0 as it will wrongly inform the user that there are no children and for instance that an article can be safely deleted.

wiki.conf.settings.STORAGE_BACKEND = <django.core.files.storage.DefaultStorage object>

Default Django storage backend to use for images, attachments etc.

wiki.conf.settings.URL_CASE_SENSITIVE = False

Should urls be case sensitive?

wiki.conf.settings.URL_CONFIG_CLASS = u'wiki.urls.WikiURLPatterns'

Dotted name of the class used to construct urlpatterns for the wiki. Default is wiki.urls.WikiURLPatterns. To customize urls or view handlers, you can derive from this.

wiki.conf.settings.USE_BOOTSTRAP_SELECT_WIDGET = True

User Bootstrap’s select widget. Switch off if you’re not using Bootstrap!

wiki.conf.settings.USE_SENDFILE = False

Use django-sendfile for sending out files? Otherwise the whole file is first read into memory and than send with a mime type based on the file.

Plugin attachments

wiki.plugins.attachments.settings.ANONYMOUS = False

Allow anonymous users upload access (not nice on an open network) WIKI_ATTACHMENTS_ANONYMOUS can override this, otherwise the default in wiki.conf.settings is used.

wiki.plugins.attachments.settings.APPEND_EXTENSION = True

Store files always with an appended .upload extension to be sure that something nasty does not get executed on the server. SAFETY FIRST!

wiki.plugins.attachments.settings.FILE_EXTENSIONS = [u'pdf', u'doc', u'odt', u'docx', u'txt']

Allowed extensions for attachments, empty to disallow uploads completely. If WIKI_ATTACHMENTS_APPEND_EXTENSION files are saved with an appended ”.upload” to the file to ensure that your web server never actually executes some script. The extensions are case insensitive. You are asked to explicitly enter all file extensions that you want to allow. For your own safety.

wiki.plugins.attachments.settings.STORAGE_BACKEND = <django.core.files.storage.DefaultStorage object>

Storage backend to use, default is to use the same as the rest of the wiki, which is set in WIKI_STORAGE_BACKEND, but you can override it with WIKI_ATTACHMENTS_STORAGE_BACKEND.

wiki.plugins.attachments.settings.UPLOAD_PATH = u'wiki/attachments/%aid/'

Where to store article attachments, relative to MEDIA_ROOT. You should NEVER enable directory indexing in MEDIA_ROOT/UPLOAD_PATH! Actually, you can completely disable serving it, if you want. Files are sent to the user through a Django view that reads and streams a file.

wiki.plugins.attachments.settings.UPLOAD_PATH_OBSCURIFY = True

Should the upload path be obscurified? If so, a random hash will be added to the path such that someone can not guess the location of files (if you have restricted permissions and the files are still located within the web server’s file system).

wiki.plugins.attachments.settings.USE_LOCAL_PATH = True

Important for e.g. S3 backends: If your storage backend does not have a .path attribute for the file, but only a .url attribute, you should use False. This will reveal the direct download URL so it does not work perfectly for files you wish to be kept private.

Plugin images

wiki.plugins.images.settings.ANONYMOUS = False

Allow anonymous users upload access (not nice on an open network). WIKI_IMAGES_ANONYMOUS can override this, otherwise the default in wiki.conf.settings is used.

wiki.plugins.images.settings.IMAGE_PATH = u'wiki/images/%aid/'

Location where uploaded images are stored. %aid is replaced by the article id.

wiki.plugins.images.settings.IMAGE_PATH_OBSCURIFY = True

Should the upload path be obscurified? If so, a random hash will be added to the path such that someone can not guess the location of files (if you have restricted permissions and the files are still located within the web server’s file system).

wiki.plugins.images.settings.STORAGE_BACKEND = <django.core.files.storage.DefaultStorage object>

Storage backend to use, default is to use the same as the rest of the wiki, which is set in WIKI_STORAGE_BACKEND, but you can override it with WIKI_IMAGES_STORAGE_BACKEND.

wiki.plugins.images.settings.THUMBNAIL_SIZES = {u'default': u'250x250', u'small': u'150x150', u'large': u'500x500', u'medium': u'300x300', u'orig': None}

Size for the image thumbnail included in the HTML text. If no specific size is given in the markdown tag the default size is used. If a specific size is given in the markdown tag that size is used.

Plugin links

wiki.plugins.links.settings.LOOKUP_LEVEL = 2

If a relative slug is used in a wiki markdown link and no article is found with the given slug starting at the current articles level a link to a not yet existing article is created. Creating the article can be done by following the link. This link will be relative to LOOKUP_LEVEL. This should be the level that most articles are created at.

Plugin macros

wiki.plugins.macros.settings.METHODS = (u'article_list', u'toc')

List of markdown extensions this plugin should support. article_list inserts a list of articles from the current level. toc inserts a table of contents matching the headings.