defaults.py 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. """
  2. Default Misago settings. Override these with settings in the module pointed to
  3. by the DJANGO_SETTINGS_MODULE environment variable.
  4. If you rely on any of those in your code, make sure you use `misago.conf.settings`
  5. instead of Django's `django.conf.settings`.
  6. """
  7. # Permissions system extensions
  8. # https://misago.readthedocs.io/en/latest/developers/acls.html#extending-permissions-system
  9. MISAGO_ACL_EXTENSIONS = [
  10. 'misago.users.permissions.account',
  11. 'misago.users.permissions.profiles',
  12. 'misago.users.permissions.moderation',
  13. 'misago.users.permissions.delete',
  14. 'misago.categories.permissions',
  15. 'misago.threads.permissions.attachments',
  16. 'misago.threads.permissions.polls',
  17. 'misago.threads.permissions.threads',
  18. 'misago.threads.permissions.privatethreads',
  19. 'misago.search.permissions',
  20. ]
  21. # Custom markup extensions
  22. MISAGO_MARKUP_EXTENSIONS = []
  23. # Custom post validators
  24. MISAGO_POST_VALIDATORS = []
  25. # Post search filters
  26. MISAGO_POST_SEARCH_FILTERS = []
  27. # Bleach callbacks for linkifying paragraphs
  28. MISAGO_BLEACH_CALLBACKS = []
  29. # Posting middlewares
  30. # https://misago.readthedocs.io/en/latest/developers/posting_process.html
  31. MISAGO_POSTING_MIDDLEWARES = [
  32. # Always keep FloodProtectionMiddleware middleware first one
  33. 'misago.threads.api.postingendpoint.floodprotection.FloodProtectionMiddleware',
  34. 'misago.threads.api.postingendpoint.category.CategoryMiddleware',
  35. 'misago.threads.api.postingendpoint.privatethread.PrivateThreadMiddleware',
  36. 'misago.threads.api.postingendpoint.reply.ReplyMiddleware',
  37. 'misago.threads.api.postingendpoint.moderationqueue.ModerationQueueMiddleware',
  38. 'misago.threads.api.postingendpoint.attachments.AttachmentsMiddleware',
  39. 'misago.threads.api.postingendpoint.participants.ParticipantsMiddleware',
  40. 'misago.threads.api.postingendpoint.pin.PinMiddleware',
  41. 'misago.threads.api.postingendpoint.close.CloseMiddleware',
  42. 'misago.threads.api.postingendpoint.hide.HideMiddleware',
  43. 'misago.threads.api.postingendpoint.protect.ProtectMiddleware',
  44. 'misago.threads.api.postingendpoint.recordedit.RecordEditMiddleware',
  45. 'misago.threads.api.postingendpoint.updatestats.UpdateStatsMiddleware',
  46. 'misago.threads.api.postingendpoint.mentions.MentionsMiddleware',
  47. 'misago.threads.api.postingendpoint.subscribe.SubscribeMiddleware',
  48. 'misago.threads.api.postingendpoint.syncprivatethreads.SyncPrivateThreadsMiddleware',
  49. # Always keep SaveChangesMiddleware middleware after all state-changing middlewares
  50. 'misago.threads.api.postingendpoint.savechanges.SaveChangesMiddleware',
  51. # Those middlewares are last because they don't change app state
  52. 'misago.threads.api.postingendpoint.emailnotification.EmailNotificationMiddleware',
  53. ]
  54. # Configured thread types
  55. MISAGO_THREAD_TYPES = [
  56. 'misago.threads.threadtypes.thread.Thread',
  57. 'misago.threads.threadtypes.privatethread.PrivateThread',
  58. ]
  59. # Search extensions
  60. MISAGO_SEARCH_EXTENSIONS = [
  61. 'misago.threads.search.SearchThreads',
  62. 'misago.users.search.SearchUsers',
  63. ]
  64. # Misago-admin specific date formats
  65. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH = 'j M'
  66. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH_YEAR = 'M \'y'
  67. # Additional registration validators
  68. # https://misago.readthedocs.io/en/latest/developers/validating_registrations.html
  69. MISAGO_NEW_REGISTRATIONS_VALIDATORS = [
  70. 'misago.users.validators.validate_gmail_email',
  71. 'misago.users.validators.validate_with_sfs',
  72. ]
  73. # Custom profile fields
  74. MISAGO_PROFILE_FIELDS = []
  75. # Stop Forum Spam settings
  76. MISAGO_USE_STOP_FORUM_SPAM = True
  77. MISAGO_STOP_FORUM_SPAM_MIN_CONFIDENCE = 80
  78. # Login API URL
  79. MISAGO_LOGIN_API_URL = 'auth'
  80. # Misago Admin Path
  81. # Omit starting and trailing slashes. To disable Misago admin, empty this value.
  82. MISAGO_ADMIN_PATH = 'admincp'
  83. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  84. MISAGO_ADMIN_NAMESPACES = [
  85. 'admin',
  86. 'misago:admin',
  87. ]
  88. # How long (in minutes) since previous request to admin namespace should admin session last.
  89. MISAGO_ADMIN_SESSION_EXPIRATION = 60
  90. # Display threads on forum index
  91. # Change this to false to display categories list instead
  92. MISAGO_THREADS_ON_INDEX = True
  93. # Max age of notifications in days
  94. # Notifications older than this are deleted. On very active forums its better to keep this smaller.
  95. MISAGO_NOTIFICATIONS_MAX_AGE = 40
  96. # Fail-safe limits in case forum is raided by spambot
  97. # No user may exceed those limits, however you may disable them by changing them to 0.
  98. MISAGO_DIALY_POST_LIMIT = 600
  99. MISAGO_HOURLY_POST_LIMIT = 100
  100. # Function used for generating individual avatar for user
  101. MISAGO_DYNAMIC_AVATAR_DRAWER = 'misago.users.avatars.dynamic.draw_default'
  102. # Path to directory containing avatar galleries
  103. # Those galleries can be loaded by running loadavatargallery command
  104. MISAGO_AVATAR_GALLERY = None
  105. # Save user avatars for sizes
  106. # Keep sizes ordered from greatest to smallest
  107. # Max size also controls min size of uploaded image as well as crop size
  108. MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
  109. # Path to blank avatar image used for guests and removed users.
  110. MISAGO_BLANK_AVATAR = 'blank-avatar.png'
  111. # Threads lists pagination settings
  112. MISAGO_THREADS_PER_PAGE = 25
  113. MISAGO_THREADS_TAIL = 15
  114. # Posts lists pagination settings
  115. MISAGO_POSTS_PER_PAGE = 18
  116. MISAGO_POSTS_TAIL = 6
  117. # Number of events displayed on single thread page
  118. # If there's more events than specified, oldest events will be trimmed
  119. MISAGO_EVENTS_PER_PAGE = 20
  120. # Number of attachments possible to assign to single post
  121. MISAGO_POST_ATTACHMENTS_LIMIT = 16
  122. # Max allowed size of image before Misago will generate thumbnail for it
  123. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  124. # Length of secret used for attachments url tokens and filenames
  125. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  126. # How old (in minutes) should attachments unassociated with any be before they'll
  127. # automatically deleted by "clearattachments" task
  128. MISAGO_ATTACHMENT_ORPHANED_EXPIRE = 24 * 60
  129. # Names of files served when user requests file that doesn't exist or is unavailable
  130. # Those files will be sought within STATIC_ROOT directory
  131. MISAGO_404_IMAGE = 'misago/img/error-404.png'
  132. MISAGO_403_IMAGE = 'misago/img/error-403.png'
  133. # Controls max age in days of items that Misago has to process to make rankings
  134. # Used for active posters and most liked users lists
  135. # If your forum runs out of memory when trying to generate users rankings list
  136. # or you want those to be more dynamic, give this setting lower value
  137. # You don't have to be overzelous with this as user rankings are cached for 24h
  138. MISAGO_RANKING_LENGTH = 30
  139. # Controls max number of items displayed on ranked lists
  140. MISAGO_RANKING_SIZE = 50
  141. # Controls number of users displayed on single page
  142. MISAGO_USERS_PER_PAGE = 12
  143. # Controls amount of data used by readtracking system
  144. # Items older than number of days specified below are considered read
  145. # Depending on amount of new content being posted on your forum you may want
  146. # To decrease or increase this number to fine-tune readtracker performance
  147. MISAGO_READTRACKER_CUTOFF = 40
  148. # Available Moment.js locales
  149. MISAGO_MOMENT_JS_LOCALES = [
  150. 'af',
  151. 'ar-ma', 'ar-sa', 'ar-tn', 'ar',
  152. 'az',
  153. 'be',
  154. 'bg',
  155. 'bn',
  156. 'bo',
  157. 'br',
  158. 'bs',
  159. 'ca',
  160. 'cs',
  161. 'cv',
  162. 'cy',
  163. 'da',
  164. 'de-at', 'de',
  165. 'el',
  166. 'en-au', 'en-ca', 'en-gb',
  167. 'eo',
  168. 'es',
  169. 'et',
  170. 'eu',
  171. 'fa',
  172. 'fi',
  173. 'fo',
  174. 'fr-ca',
  175. 'fr',
  176. 'fy',
  177. 'gl',
  178. 'he',
  179. 'hi',
  180. 'hr',
  181. 'hu', 'hy-am',
  182. 'id',
  183. 'is',
  184. 'it',
  185. 'ja',
  186. 'ka',
  187. 'km',
  188. 'ko',
  189. 'lb',
  190. 'lt',
  191. 'lv',
  192. 'mk',
  193. 'ml',
  194. 'mr',
  195. 'ms-my', 'my',
  196. 'nb',
  197. 'ne',
  198. 'nl',
  199. 'nn',
  200. 'pl',
  201. 'pt-br', 'pt',
  202. 'ro',
  203. 'ru',
  204. 'sk',
  205. 'sl',
  206. 'sq',
  207. 'sr-cyrl', 'sr',
  208. 'sv',
  209. 'ta',
  210. 'th',
  211. 'tl-ph',
  212. 'tr',
  213. 'tzm-latn', 'tzm',
  214. 'uk',
  215. 'uz',
  216. 'vi',
  217. 'zh-cn', 'zh-hans', 'zh-tw',
  218. ]