Settings

These are the default settings. They can be overridden by the project settings

ST_ALLOWED_UPLOAD_FILE_MEDIA_TYPE = {u'doc': u'application/msword', u'docx': u'application/vnd.openxmlformats-officedocument.wordprocessingml.document', u'pdf': u'application/pdf'}

Uploaded files will be validated against these formats. This is a map of extension and media-type. Both are used for validation

Note

To find a media-type just add an extension and an empty media-type, then try uploading a valid file for that extension and the expected media-type will be printed within the validation error. Either that or use the Linux file --mime-type ./my_file command

ST_ALLOWED_UPLOAD_IMAGE_FORMAT = (u'jpeg', u'jpg', u'gif')

Uploaded images will be validated against these formats. Also, the file choosing dialog will filter by these extensions. See the Pillow docs for a list of supported formats

Warning

Allowing PNG files is a security risk as it may contain malicious HTML. See Django notes

ST_ALLOWED_URL_PROTOCOLS = set([u'ftp', u'ftps', u'git', u'http', u'https', u'irc', u'ircs', u'magnet', u'mailto', u'svn'])

Link protocols allowed within posts

ST_CASE_INSENSITIVE_EMAILS = True

Make emails case insensitive

ST_CASE_INSENSITIVE_USERNAMES = True

Make user-names case insensitive

Note

This can be set to False at any time, however setting it back to True requires taking care of clashing users, i.e: someuser, SomeUser and SoMeUsEr, only one of those users will be able log-in (the one in lowercase). Removing clashing users is usually not possible.

ST_COMMENT_MAX_LEN = 3000

Maximum length for a comment

ST_DOUBLE_POST_THRESHOLD_MINUTES = 30

Minutes to wait before a given user will be able to post a duplicated comment/topic

ST_MATH_JAX = False

Enable MathJax. Spirit’s markdown supports math notation with $$...$$, \(...\), \[...\] and \begin{abc}...\end{abc}, this merely insert the MathJax script into the HTML.

ST_MENTIONS_PER_COMMENT = 30

Maximum number of mentions per comment willing to process

ST_NOTIFICATIONS_PER_PAGE = 20

Number of notifications per page

ST_ORDERED_CATEGORIES = False

Enable/disable category ordering.

ST_PREVENT_SOME_FILE_DUPLICATION = False

Prevent duplication of files uploaded by a user. Including images. This is not across all users, but a single user.

Be aware the de-duplication is based on a file hash calculation, which is quite slow and it will degrade the server’s performance.

All files will have the hash as name and the original file’s name will be lost.

Note

Defaults to False since Spirit 0.8

ST_PRIVATE_FORUM = False

Settings this to True will require all users to be logged-in to access any section

ST_RATELIMIT_CACHE = u'st_rate_limit'

The cache ID for storing rate-limit related data. The cache ID must be a valid CACHES entry and the TIMEOUT must be None otherwise it will misbehave

ST_RATELIMIT_CACHE_PREFIX = u'srl'

The cache key prefix. This is mostly to avoid clashing with other apps

ST_RATELIMIT_ENABLE = True

Enable/disable the rate-limit for all forms

ST_RATELIMIT_SKIP_TIMEOUT_CHECK = False

A warning will be printed when the TIMEOUT is not None. Setting this to True will silence it.

Warning

A ConfigurationError will be raised instead of a warning in Spirit > 0.5

ST_SEARCH_QUERY_MIN_LEN = 3

Minimum length for a given search query

ST_TOPIC_PRIVATE_CATEGORY_PK = 1

The category’s PK containing all of the private topics. The category is auto-created and so this value should not change

ST_UNICODE_SLUGS = True

Support unicode slugs. Set to False to only allow ASCII chars

ST_UNIQUE_EMAILS = True

Reject duplicated emails when creating a new account

ST_UPLOAD_FILE_ENABLED = False

Enable/disable file uploads within posts. Requires running pip install django-spirit[files] to install python-magic

ST_UPLOAD_IMAGE_ENABLED = True

Enable/disable image uploads within posts

ST_USER_LAST_SEEN_THRESHOLD_MINUTES = 1

Threshold in minutes before the user “last seen” info can be updated

ST_YT_PAGINATOR_PAGE_RANGE = 3

Number of next/previous pages the paginator will show