settings_base.py 8.5 KB

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