settings_base.py 7.4 KB

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