defaults.py 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. # Default JS debug to false
  8. # This setting used exclusively by test runner and isn't part of public API
  9. _MISAGO_JS_DEBUG = False
  10. # Permissions system extensions
  11. # https://misago.readthedocs.io/en/latest/developers/acls.html#extending-permissions-system
  12. MISAGO_ACL_EXTENSIONS = (
  13. 'misago.users.permissions.account',
  14. 'misago.users.permissions.profiles',
  15. 'misago.users.permissions.moderation',
  16. 'misago.users.permissions.delete',
  17. 'misago.categories.permissions',
  18. 'misago.threads.permissions.attachments',
  19. 'misago.threads.permissions.polls',
  20. 'misago.threads.permissions.threads',
  21. 'misago.threads.permissions.privatethreads',
  22. 'misago.search.permissions',
  23. )
  24. # Custom markup extensions
  25. MISAGO_MARKUP_EXTENSIONS = ()
  26. # Posting middlewares
  27. # https://misago.readthedocs.io/en/latest/developers/posting_process.html
  28. MISAGO_POSTING_MIDDLEWARES = (
  29. # Always keep FloodProtectionMiddleware middleware first one
  30. 'misago.threads.api.postingendpoint.floodprotection.FloodProtectionMiddleware',
  31. 'misago.threads.api.postingendpoint.category.CategoryMiddleware',
  32. 'misago.threads.api.postingendpoint.privatethread.PrivateThreadMiddleware',
  33. 'misago.threads.api.postingendpoint.reply.ReplyMiddleware',
  34. 'misago.threads.api.postingendpoint.attachments.AttachmentsMiddleware',
  35. 'misago.threads.api.postingendpoint.participants.ParticipantsMiddleware',
  36. 'misago.threads.api.postingendpoint.pin.PinMiddleware',
  37. 'misago.threads.api.postingendpoint.close.CloseMiddleware',
  38. 'misago.threads.api.postingendpoint.hide.HideMiddleware',
  39. 'misago.threads.api.postingendpoint.protect.ProtectMiddleware',
  40. 'misago.threads.api.postingendpoint.recordedit.RecordEditMiddleware',
  41. 'misago.threads.api.postingendpoint.updatestats.UpdateStatsMiddleware',
  42. 'misago.threads.api.postingendpoint.mentions.MentionsMiddleware',
  43. 'misago.threads.api.postingendpoint.subscribe.SubscribeMiddleware',
  44. 'misago.threads.api.postingendpoint.syncprivatethreads.SyncPrivateThreadsMiddleware',
  45. # Always keep SaveChangesMiddleware middleware after all state-changing middlewares
  46. 'misago.threads.api.postingendpoint.savechanges.SaveChangesMiddleware',
  47. # Those middlewares are last because they don't change app state
  48. 'misago.threads.api.postingendpoint.emailnotification.EmailNotificationMiddleware',
  49. )
  50. # Configured thread types
  51. MISAGO_THREAD_TYPES = (
  52. 'misago.threads.threadtypes.thread.Thread',
  53. 'misago.threads.threadtypes.privatethread.PrivateThread',
  54. )
  55. # Search extensions
  56. MISAGO_SEARCH_EXTENSIONS = (
  57. 'misago.threads.search.SearchThreads',
  58. 'misago.users.search.SearchUsers',
  59. )
  60. # Misago-admin specific date formats
  61. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH = 'j M'
  62. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH_YEAR = 'M \'y'
  63. # Additional registration validators
  64. # https://misago.readthedocs.io/en/latest/developers/validating_registrations.html
  65. MISAGO_NEW_REGISTRATIONS_VALIDATORS = (
  66. 'misago.users.validators.validate_gmail_email',
  67. 'misago.users.validators.validate_with_sfs',
  68. )
  69. # Stop Forum Spam settings
  70. MISAGO_USE_STOP_FORUM_SPAM = True
  71. MISAGO_STOP_FORUM_SPAM_MIN_CONFIDENCE = 80
  72. # Login API URL
  73. MISAGO_LOGIN_API_URL = 'auth'
  74. # Misago Admin Path
  75. # Omit starting and trailing slashes. To disable Misago admin, empty this value.
  76. MISAGO_ADMIN_PATH = 'admincp'
  77. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  78. MISAGO_ADMIN_NAMESPACES = (
  79. 'admin',
  80. 'misago:admin',
  81. )
  82. # How long (in minutes) since previous request to admin namespace should admin session last.
  83. MISAGO_ADMIN_SESSION_EXPIRATION = 60
  84. # Display threads on forum index
  85. # Change this to false to display categories list instead
  86. MISAGO_THREADS_ON_INDEX = True
  87. # Max age of notifications in days
  88. # Notifications older than this are deleted. On very active forums its better to keep this smaller.
  89. MISAGO_NOTIFICATIONS_MAX_AGE = 40
  90. # Fail-safe limits in case forum is raided by spambot
  91. # No user may exceed those limits, however you may disable them by changing them to 0.
  92. MISAGO_DIALY_POST_LIMIT = 600
  93. MISAGO_HOURLY_POST_LIMIT = 100
  94. # Function used for generating individual avatar for user
  95. MISAGO_DYNAMIC_AVATAR_DRAWER = 'misago.users.avatars.dynamic.draw_default'
  96. # Path to directory containing avatar galleries
  97. # Those galleries can be loaded by running loadavatargallery command
  98. MISAGO_AVATAR_GALLERY = None
  99. # Save user avatars for sizes
  100. # Keep sizes ordered from greatest to smallest
  101. # Max size also controls min size of uploaded image as well as crop size
  102. MISAGO_AVATARS_SIZES = (400, 200, 150, 100, 64, 50, 30)
  103. # Path to blank avatar image used for guests and removed users.
  104. MISAGO_BLANK_AVATAR = 'blank-avatar.png'
  105. # Threads lists pagination settings
  106. MISAGO_THREADS_PER_PAGE = 25
  107. MISAGO_THREADS_TAIL = 15
  108. # Posts lists pagination settings
  109. MISAGO_POSTS_PER_PAGE = 18
  110. MISAGO_POSTS_TAIL = 6
  111. # Number of events displayed on single thread page
  112. # If there's more events than specified, oldest events will be trimmed
  113. MISAGO_EVENTS_PER_PAGE = 20
  114. # Number of attachments possible to assign to single post
  115. MISAGO_POST_ATTACHMENTS_LIMIT = 16
  116. # Max allowed size of image before Misago will generate thumbnail for it
  117. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  118. # Length of secret used for attachments url tokens and filenames
  119. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  120. # How old (in minutes) should attachments unassociated with any be before they'll
  121. # automatically deleted by "clearattachments" task
  122. MISAGO_ATTACHMENT_ORPHANED_EXPIRE = 24 * 60
  123. # Names of files served when user requests file that doesn't exist or is unavailable
  124. # Those files will be sought within STATIC_ROOT directory
  125. MISAGO_404_IMAGE = 'misago/img/error-404.png'
  126. MISAGO_403_IMAGE = 'misago/img/error-403.png'
  127. # Controls max age in days of items that Misago has to process to make rankings
  128. # Used for active posters and most liked users lists
  129. # If your forum runs out of memory when trying to generate users rankings list
  130. # or you want those to be more dynamic, give this setting lower value
  131. # You don't have to be overzelous with this as user rankings are cached for 24h
  132. MISAGO_RANKING_LENGTH = 30
  133. # Controls max number of items displayed on ranked lists
  134. MISAGO_RANKING_SIZE = 50
  135. # Controls number of users displayed on single page
  136. MISAGO_USERS_PER_PAGE = 12
  137. # Controls amount of data used by readtracking system
  138. # Items older than number of days specified below are considered read
  139. # Depending on amount of new content being posted on your forum you may want
  140. # To decrease or increase this number to fine-tune readtracker performance
  141. MISAGO_READTRACKER_CUTOFF = 40