settings_base.py 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import os
  2. # Board address
  3. BOARD_ADDRESS = 'http://127.0.0.1:8000/'
  4. # Admin control panel path
  5. # Leave this setting empty
  6. ADMIN_PATH = ''
  7. # Default format of Misago generated HTML
  8. OUTPUT_FORMAT = 'html5'
  9. # Default avatar sizes
  10. # Those are avatar sizes Misago generates images for
  11. # Remember to run "genavatars" command when you change this setting!
  12. AVATAR_SIZES = (125, 100, 80, 60, 40, 24)
  13. # If you set this to False, Django will make some optimizations so as not
  14. # to load the internationalization machinery.
  15. USE_I18N = True
  16. # If you set this to False, Django will not format dates, numbers and
  17. # calendars according to the current locale.
  18. USE_L10N = True
  19. # If you set this to False, Django will not use timezone-aware datetimes.
  20. USE_TZ = True
  21. # List of directories that contain Misago locale files
  22. # Defautly set Django to look for Misago translations in misago/locale directory
  23. LOCALE_PATHS = (
  24. ('%slocale%s' % (os.path.dirname( __file__ ) + os.sep, os.sep)),
  25. )
  26. # Catch-all e-mail address
  27. # If DEBUG_MODE is on, all emails will be sent to this address instead of real recipient.
  28. CATCH_ALL_EMAIL_ADDRESS = ''
  29. # Forums and threads read tracker length (days
  30. # Enter 0 to turn tracking off
  31. # The bigger the number, then longer tracker keeps threads reads
  32. # information and the more costful it is to track reads
  33. READS_TRACKER_LENGTH = 7
  34. # List of finder classes that know how to find static files in
  35. # various locations.
  36. STATICFILES_FINDERS = (
  37. 'django.contrib.staticfiles.finders.FileSystemFinder',
  38. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  39. )
  40. # List of callables that know how to import templates from various sources.
  41. TEMPLATE_LOADERS = (
  42. 'django.template.loaders.filesystem.Loader',
  43. 'django.template.loaders.app_directories.Loader',
  44. )
  45. # Context processors
  46. TEMPLATE_CONTEXT_PROCESSORS = (
  47. 'django.core.context_processors.debug',
  48. 'django.core.context_processors.i18n',
  49. 'django.core.context_processors.media',
  50. 'django.core.context_processors.static',
  51. 'django.core.context_processors.tz',
  52. 'django.contrib.messages.context_processors.messages',
  53. 'misago.context_processors.core',
  54. 'misago.admin.context_processors.admin',
  55. 'misago.banning.context_processors.banning',
  56. 'misago.messages.context_processors.messages',
  57. 'misago.monitor.context_processors.monitor',
  58. 'misago.settings.context_processors.settings',
  59. 'misago.bruteforce.context_processors.is_jammed',
  60. 'misago.csrf.context_processors.csrf',
  61. 'misago.users.context_processors.user',
  62. 'misago.acl.context_processors.acl',
  63. )
  64. # Jinja2 Template Extensions
  65. JINJA2_EXTENSIONS = (
  66. 'jinja2.ext.do',
  67. )
  68. # List of application middlewares
  69. MIDDLEWARE_CLASSES = (
  70. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  71. 'misago.cookie_jar.middleware.CookieJarMiddleware',
  72. 'misago.settings.middleware.SettingsMiddleware',
  73. 'misago.monitor.middleware.MonitorMiddleware',
  74. 'misago.themes.middleware.ThemeMiddleware',
  75. 'misago.firewalls.middleware.FirewallMiddleware',
  76. 'misago.crawlers.middleware.DetectCrawlerMiddleware',
  77. 'misago.sessions.middleware.SessionMiddleware',
  78. 'misago.bruteforce.middleware.JamMiddleware',
  79. 'misago.csrf.middleware.CSRFMiddleware',
  80. 'misago.banning.middleware.BanningMiddleware',
  81. 'misago.messages.middleware.MessagesMiddleware',
  82. 'misago.users.middleware.UserMiddleware',
  83. 'misago.acl.middleware.ACLMiddleware',
  84. 'django.middleware.common.CommonMiddleware',
  85. )
  86. # List of application permission providers
  87. PERMISSION_PROVIDERS = (
  88. 'misago.usercp.acl',
  89. 'misago.admin.acl',
  90. 'misago.forums.acl',
  91. 'misago.threads.acl',
  92. )
  93. # List of UserCP extensions
  94. USERCP_EXTENSIONS = (
  95. 'misago.usercp.options',
  96. 'misago.usercp.avatar',
  97. 'misago.usercp.signature',
  98. 'misago.usercp.credentials',
  99. 'misago.usercp.username',
  100. 'misago.usercp.blocked',
  101. )
  102. # List of User Profile extensions
  103. PROFILE_EXTENSIONS = (
  104. '',
  105. '',
  106. )
  107. # List of Markdown Extensions
  108. MARKDOWN_EXTENSIONS = (
  109. 'misago.markdown.extensions.quotes.QuoteTitlesExtension',
  110. 'misago.markdown.extensions.ats.AtsExtension',
  111. )
  112. # Name of root urls configuration
  113. ROOT_URLCONF = 'misago.urls'
  114. #Installed applications
  115. INSTALLED_APPS = (
  116. # Applications that have no dependencies first!
  117. 'south',
  118. 'coffin',
  119. 'django.contrib.staticfiles',
  120. 'django.contrib.humanize',
  121. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  122. 'debug_toolbar', # Debug toolbar
  123. 'misago.acl', # ACL Builder and dehydrator
  124. 'misago.settings', # Database level application configuration
  125. 'misago.monitor', # Forum statistics monitor
  126. 'misago.utils', # Utility classes
  127. 'misago.tos', # Terms of Service AKA Guidelines
  128. # Applications with dependencies
  129. 'misago.banning', # Banning and blacklisting users
  130. 'misago.crawlers', # Web crawlers handling
  131. 'misago.cookie_jar', # Cookies helper
  132. 'misago.captcha', # Web crawlers handling
  133. 'misago.forums', # Forums, threads and posts
  134. 'misago.messages', # Messages and Flashes
  135. 'misago.newsletters', # Send newsletters to members from Admin
  136. 'misago.stats', # Admin statistics generator
  137. 'misago.sessions', # Sessions
  138. 'misago.authn', # User authentication
  139. 'misago.bruteforce', # Brute-Force protection
  140. 'misago.csrf', # Cross Site Request Forgery protection
  141. 'misago.setup', # Installation/update tool
  142. 'misago.template', # Templates extensions
  143. 'misago.themes', # Themes
  144. 'misago.users', # Users foundation
  145. 'misago.alerts', # Users Notifications
  146. 'misago.team', # Forum Team List
  147. 'misago.prune', # Prune Users
  148. 'misago.ranks', # User Ranks
  149. 'misago.roles', # User Roles
  150. 'misago.forumroles', # Forum Roles
  151. 'misago.usercp', # User Control Panel
  152. 'misago.profiles', # User Profiles
  153. 'misago.register', # Register New Users
  154. 'misago.activation', # Activate inactive User or resend activation e-mail
  155. 'misago.resetpswd', # Reset User Password
  156. 'misago.threads', # Threads and Posts
  157. 'misago.readstracker', # Forums and Threads reads tracker
  158. )
  159. # IP's that can see debug toolbar
  160. INTERNAL_IPS = ('127.0.0.1', '::1')
  161. # Debug toolbar config
  162. DEBUG_TOOLBAR_CONFIG = {
  163. 'INTERCEPT_REDIRECTS': False
  164. }
  165. # List panels displayed by toolbar
  166. DEBUG_TOOLBAR_PANELS = (
  167. 'debug_toolbar.panels.timer.TimerDebugPanel',
  168. 'debug_toolbar.panels.sql.SQLDebugPanel',
  169. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  170. 'misago.acl.panels.MisagoACLDebugPanel',
  171. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  172. 'debug_toolbar.panels.template.TemplateDebugPanel',
  173. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  174. 'debug_toolbar.panels.signals.SignalDebugPanel',
  175. 'debug_toolbar.panels.logger.LoggingPanel',
  176. 'debug_toolbar.panels.version.VersionDebugPanel',
  177. )
  178. # Turn off caching
  179. CACHES = {
  180. 'default': {
  181. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  182. }
  183. }
  184. # A sample logging configuration. The only tangible logging
  185. # performed by this configuration is to send an email to
  186. # the site admins on every HTTP 500 error when DEBUG=False.
  187. # See http://docs.djangoproject.com/en/dev/topics/logging for
  188. # more details on how to customize your logging configuration.
  189. LOGGING = {
  190. 'version': 1,
  191. 'disable_existing_loggers': False,
  192. 'filters': {
  193. 'require_debug_false': {
  194. '()': 'django.utils.log.RequireDebugFalse'
  195. }
  196. },
  197. 'handlers': {
  198. 'mail_admins': {
  199. 'level': 'ERROR',
  200. 'filters': ['require_debug_false'],
  201. 'class': 'django.utils.log.AdminEmailHandler'
  202. }
  203. },
  204. 'loggers': {
  205. 'django.request': {
  206. 'handlers': ['mail_admins'],
  207. 'level': 'ERROR',
  208. 'propagate': True,
  209. },
  210. }
  211. }