settings_base.py 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.security.context_processors.security',
  49. 'misago.users.context_processors.user',
  50. )
  51. # Jinja2 Template Extensions
  52. JINJA2_EXTENSIONS = (
  53. 'jinja2.ext.do',
  54. )
  55. # List of application middlewares
  56. MIDDLEWARE_CLASSES = (
  57. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  58. 'misago.cookie_jar.middleware.CookieJarMiddleware',
  59. 'misago.settings.middleware.SettingsMiddleware',
  60. 'misago.monitor.middleware.MonitorMiddleware',
  61. 'misago.themes.middleware.ThemeMiddleware',
  62. 'misago.security.middleware.FirewallMiddleware',
  63. 'misago.crawlers.middleware.DetectCrawlerMiddleware',
  64. 'misago.sessions.middleware.SessionMiddleware',
  65. 'misago.security.middleware.JamMiddleware',
  66. 'misago.security.middleware.CSRFMiddleware',
  67. 'misago.banning.middleware.BanningMiddleware',
  68. 'misago.messages.middleware.MessagesMiddleware',
  69. 'misago.users.middleware.UserMiddleware',
  70. 'misago.acl.middleware.ACLMiddleware',
  71. 'django.middleware.common.CommonMiddleware',
  72. )
  73. # Name of root urls configuration
  74. ROOT_URLCONF = 'misago.urls'
  75. #Installed applications
  76. INSTALLED_APPS = (
  77. # Applications that have no dependencies first!
  78. 'south',
  79. 'coffin',
  80. 'django.contrib.staticfiles',
  81. 'django.contrib.humanize',
  82. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  83. 'debug_toolbar', # Debug toolbar
  84. 'misago.settings', # Database level application configuration
  85. 'misago.monitor', # Forum statistics monitor
  86. 'misago.utils', # Utility classes
  87. # Applications with dependencies
  88. 'misago.acl', # Web crawlers handling
  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.stats', # Admin statistics generator
  95. 'misago.security', # Security: CSRF, Firewall, etc ect
  96. 'misago.sessions', # Sessions
  97. 'misago.setup', # Installation/update tool
  98. 'misago.stopwatch', # Simple stopwatch to measure time spent on request
  99. 'misago.template', # Templates extensions
  100. 'misago.themes', # Themes
  101. 'misago.users', # Users and groups
  102. )
  103. # IP's that can see debug toolbar
  104. INTERNAL_IPS = ('127.0.0.1', '::1')
  105. # Debug toolbar config
  106. DEBUG_TOOLBAR_CONFIG = {
  107. 'INTERCEPT_REDIRECTS': False
  108. }
  109. # List panels displayed by toolbar
  110. DEBUG_TOOLBAR_PANELS = (
  111. 'debug_toolbar.panels.timer.TimerDebugPanel',
  112. 'debug_toolbar.panels.sql.SQLDebugPanel',
  113. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  114. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  115. 'debug_toolbar.panels.template.TemplateDebugPanel',
  116. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  117. 'debug_toolbar.panels.signals.SignalDebugPanel',
  118. 'debug_toolbar.panels.logger.LoggingPanel',
  119. 'debug_toolbar.panels.version.VersionDebugPanel',
  120. )
  121. # Turn off caching
  122. CACHES = {
  123. 'default': {
  124. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  125. }
  126. }
  127. # A sample logging configuration. The only tangible logging
  128. # performed by this configuration is to send an email to
  129. # the site admins on every HTTP 500 error when DEBUG=False.
  130. # See http://docs.djangoproject.com/en/dev/topics/logging for
  131. # more details on how to customize your logging configuration.
  132. LOGGING = {
  133. 'version': 1,
  134. 'disable_existing_loggers': False,
  135. 'filters': {
  136. 'require_debug_false': {
  137. '()': 'django.utils.log.RequireDebugFalse'
  138. }
  139. },
  140. 'handlers': {
  141. 'mail_admins': {
  142. 'level': 'ERROR',
  143. 'filters': ['require_debug_false'],
  144. 'class': 'django.utils.log.AdminEmailHandler'
  145. }
  146. },
  147. 'loggers': {
  148. 'django.request': {
  149. 'handlers': ['mail_admins'],
  150. 'level': 'ERROR',
  151. 'propagate': True,
  152. },
  153. }
  154. }