defaults.py 7.7 KB

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