defaults.py 7.5 KB

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