settings_base.py 6.8 KB

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