defaults.py 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. # pylint: disable=line-too-long
  2. """
  3. Default Misago settings. Override these with settings in the module pointed to
  4. by the DJANGO_SETTINGS_MODULE environment variable.
  5. If you rely on any of those in your code, make sure you use `misago.conf.settings`
  6. instead of Django's `django.conf.settings`.
  7. """
  8. # Permissions system extensions
  9. # https://misago.readthedocs.io/en/latest/developers/acls.html#extending-permissions-system
  10. MISAGO_ACL_EXTENSIONS = [
  11. "misago.users.permissions.account",
  12. "misago.users.permissions.profiles",
  13. "misago.users.permissions.moderation",
  14. "misago.users.permissions.delete",
  15. "misago.categories.permissions",
  16. "misago.threads.permissions.attachments",
  17. "misago.threads.permissions.polls",
  18. "misago.threads.permissions.threads",
  19. "misago.threads.permissions.privatethreads",
  20. "misago.threads.permissions.bestanswers",
  21. "misago.search.permissions",
  22. ]
  23. # Path to the directory that Misago should use to prepare user data downloads.
  24. # Should not be accessible from internet.
  25. MISAGO_USER_DATA_DOWNLOADS_WORKING_DIR = None
  26. # Custom markup extensions
  27. MISAGO_MARKUP_EXTENSIONS = []
  28. # Bleach callbacks for linkifying paragraphs
  29. MISAGO_BLEACH_CALLBACKS = []
  30. # Custom post validators
  31. MISAGO_POST_VALIDATORS = []
  32. # Post search filters
  33. MISAGO_POST_SEARCH_FILTERS = []
  34. # Posting middlewares
  35. # https://misago.readthedocs.io/en/latest/developers/posting_process.html
  36. MISAGO_POSTING_MIDDLEWARES = [
  37. # Always keep FloodProtectionMiddleware middleware first one
  38. "misago.threads.api.postingendpoint.floodprotection.FloodProtectionMiddleware",
  39. "misago.threads.api.postingendpoint.category.CategoryMiddleware",
  40. "misago.threads.api.postingendpoint.privatethread.PrivateThreadMiddleware",
  41. "misago.threads.api.postingendpoint.reply.ReplyMiddleware",
  42. "misago.threads.api.postingendpoint.moderationqueue.ModerationQueueMiddleware",
  43. "misago.threads.api.postingendpoint.attachments.AttachmentsMiddleware",
  44. "misago.threads.api.postingendpoint.participants.ParticipantsMiddleware",
  45. "misago.threads.api.postingendpoint.pin.PinMiddleware",
  46. "misago.threads.api.postingendpoint.close.CloseMiddleware",
  47. "misago.threads.api.postingendpoint.hide.HideMiddleware",
  48. "misago.threads.api.postingendpoint.protect.ProtectMiddleware",
  49. "misago.threads.api.postingendpoint.recordedit.RecordEditMiddleware",
  50. "misago.threads.api.postingendpoint.updatestats.UpdateStatsMiddleware",
  51. "misago.threads.api.postingendpoint.mentions.MentionsMiddleware",
  52. "misago.threads.api.postingendpoint.subscribe.SubscribeMiddleware",
  53. "misago.threads.api.postingendpoint.syncprivatethreads.SyncPrivateThreadsMiddleware",
  54. # Always keep SaveChangesMiddleware middleware after all state-changing middlewares
  55. "misago.threads.api.postingendpoint.savechanges.SaveChangesMiddleware",
  56. # Those middlewares are last because they don't change app state
  57. "misago.threads.api.postingendpoint.emailnotification.EmailNotificationMiddleware",
  58. ]
  59. # Configured thread types
  60. MISAGO_THREAD_TYPES = [
  61. "misago.threads.threadtypes.thread.Thread",
  62. "misago.threads.threadtypes.privatethread.PrivateThread",
  63. ]
  64. # Search extensions
  65. MISAGO_SEARCH_EXTENSIONS = [
  66. "misago.threads.search.SearchThreads",
  67. "misago.users.search.SearchUsers",
  68. ]
  69. # Additional registration validators
  70. # https://misago.readthedocs.io/en/latest/developers/validating_registrations.html
  71. MISAGO_NEW_REGISTRATIONS_VALIDATORS = [
  72. "misago.users.validators.validate_gmail_email",
  73. "misago.users.validators.validate_with_sfs",
  74. ]
  75. # Custom profile fields
  76. MISAGO_PROFILE_FIELDS = []
  77. # Login API URL
  78. MISAGO_LOGIN_API_URL = "auth"
  79. # Misago Admin Path
  80. # Omit starting and trailing slashes. To disable Misago admin, empty this value.
  81. MISAGO_ADMIN_PATH = "admincp"
  82. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  83. MISAGO_ADMIN_NAMESPACES = ["admin", "misago:admin"]
  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. # Function used for generating individual avatar for user
  90. MISAGO_DYNAMIC_AVATAR_DRAWER = "misago.users.avatars.dynamic.draw_default"
  91. # Path to directory containing avatar galleries
  92. # Those galleries can be loaded by running loadavatargallery command
  93. MISAGO_AVATAR_GALLERY = None
  94. # Save user avatars for sizes
  95. # Keep sizes ordered from greatest to smallest
  96. # Max size also controls min size of uploaded image as well as crop size
  97. MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
  98. # Path to blank avatar image used for guests and removed users.
  99. MISAGO_BLANK_AVATAR = "misago/img/blank-avatar.png"
  100. # Max allowed size of image before Misago will generate thumbnail for it
  101. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  102. # Length of secret used for attachments url tokens and filenames
  103. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  104. # Names of files served when user requests file that doesn't exist or is unavailable
  105. MISAGO_ATTACHMENT_403_IMAGE = "misago/img/attachment-403.png"
  106. MISAGO_ATTACHMENT_404_IMAGE = "misago/img/attachment-404.png"
  107. # Available Moment.js locales
  108. MISAGO_MOMENT_JS_LOCALES = [
  109. "af",
  110. "ar-ma",
  111. "ar-sa",
  112. "ar-tn",
  113. "ar",
  114. "az",
  115. "be",
  116. "bg",
  117. "bn",
  118. "bo",
  119. "br",
  120. "bs",
  121. "ca",
  122. "cs",
  123. "cv",
  124. "cy",
  125. "da",
  126. "de-at",
  127. "de",
  128. "el",
  129. "en-au",
  130. "en-ca",
  131. "en-gb",
  132. "eo",
  133. "es",
  134. "et",
  135. "eu",
  136. "fa",
  137. "fi",
  138. "fo",
  139. "fr-ca",
  140. "fr",
  141. "fy",
  142. "gl",
  143. "he",
  144. "hi",
  145. "hr",
  146. "hu",
  147. "hy-am",
  148. "id",
  149. "is",
  150. "it",
  151. "ja",
  152. "ka",
  153. "km",
  154. "ko",
  155. "lb",
  156. "lt",
  157. "lv",
  158. "mk",
  159. "ml",
  160. "mr",
  161. "ms-my",
  162. "my",
  163. "nb",
  164. "ne",
  165. "nl",
  166. "nn",
  167. "pl",
  168. "pt-br",
  169. "pt",
  170. "ro",
  171. "ru",
  172. "sk",
  173. "sl",
  174. "sq",
  175. "sr-cyrl",
  176. "sr",
  177. "sv",
  178. "ta",
  179. "th",
  180. "tl-ph",
  181. "tr",
  182. "tzm-latn",
  183. "tzm",
  184. "uk",
  185. "uz",
  186. "vi",
  187. "zh-cn",
  188. "zh-hans",
  189. "zh-tw",
  190. ]