settings_base.py 6.3 KB

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