settings_base.py 6.1 KB

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