defaults.py 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. # Social Auth Backends Names Overrides
  78. # This seeting may be used to customise auth backends names displayed in the UI
  79. MISAGO_SOCIAL_AUTH_BACKENDS_NAMES = {}
  80. # Login API URL
  81. MISAGO_LOGIN_API_URL = "auth"
  82. # Misago Admin Path
  83. # Omit starting and trailing slashes. To disable Misago admin, empty this value.
  84. MISAGO_ADMIN_PATH = "admincp"
  85. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  86. MISAGO_ADMIN_NAMESPACES = ["admin", "misago:admin"]
  87. # How long (in minutes) since previous request to admin namespace should admin session last.
  88. MISAGO_ADMIN_SESSION_EXPIRATION = 60
  89. # Display threads on forum index
  90. # Change this to false to display categories list instead
  91. MISAGO_THREADS_ON_INDEX = True
  92. # Function used for generating individual avatar for user
  93. MISAGO_DYNAMIC_AVATAR_DRAWER = "misago.users.avatars.dynamic.draw_default"
  94. # Path to directory containing avatar galleries
  95. # Those galleries can be loaded by running loadavatargallery command
  96. MISAGO_AVATAR_GALLERY = None
  97. # Save user avatars for sizes
  98. # Keep sizes ordered from greatest to smallest
  99. # Max size also controls min size of uploaded image as well as crop size
  100. MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
  101. # Path to blank avatar image used for guests and removed users.
  102. MISAGO_BLANK_AVATAR = "misago/img/blank-avatar.png"
  103. # Max allowed size of image before Misago will generate thumbnail for it
  104. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  105. # Length of secret used for attachments url tokens and filenames
  106. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  107. # Names of files served when user requests file that doesn't exist or is unavailable
  108. MISAGO_ATTACHMENT_403_IMAGE = "misago/img/attachment-403.png"
  109. MISAGO_ATTACHMENT_404_IMAGE = "misago/img/attachment-404.png"
  110. # Available Moment.js locales
  111. MISAGO_MOMENT_JS_LOCALES = [
  112. "af",
  113. "ar-ma",
  114. "ar-sa",
  115. "ar-tn",
  116. "ar",
  117. "az",
  118. "be",
  119. "bg",
  120. "bn",
  121. "bo",
  122. "br",
  123. "bs",
  124. "ca",
  125. "cs",
  126. "cv",
  127. "cy",
  128. "da",
  129. "de-at",
  130. "de",
  131. "el",
  132. "en-au",
  133. "en-ca",
  134. "en-gb",
  135. "eo",
  136. "es",
  137. "et",
  138. "eu",
  139. "fa",
  140. "fi",
  141. "fo",
  142. "fr-ca",
  143. "fr",
  144. "fy",
  145. "gl",
  146. "he",
  147. "hi",
  148. "hr",
  149. "hu",
  150. "hy-am",
  151. "id",
  152. "is",
  153. "it",
  154. "ja",
  155. "ka",
  156. "km",
  157. "ko",
  158. "lb",
  159. "lt",
  160. "lv",
  161. "mk",
  162. "ml",
  163. "mr",
  164. "ms-my",
  165. "my",
  166. "nb",
  167. "ne",
  168. "nl",
  169. "nn",
  170. "pl",
  171. "pt-br",
  172. "pt",
  173. "ro",
  174. "ru",
  175. "sk",
  176. "sl",
  177. "sq",
  178. "sr-cyrl",
  179. "sr",
  180. "sv",
  181. "ta",
  182. "th",
  183. "tl-ph",
  184. "tr",
  185. "tzm-latn",
  186. "tzm",
  187. "uk",
  188. "uz",
  189. "vi",
  190. "zh-cn",
  191. "zh-hans",
  192. "zh-tw",
  193. ]