settings_base.py 8.5 KB

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