settings_base.py 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. import os
  2. # Board address
  3. BOARD_ADDRESS = 'http://127.0.0.1:8000/'
  4. # Allowed hosts
  5. ALLOWED_HOSTS = ['*']
  6. # Admin control panel path
  7. # Leave this setting empty
  8. ADMIN_PATH = ''
  9. # Default format of Misago generated HTML
  10. OUTPUT_FORMAT = 'html5'
  11. # Default avatar sizes
  12. # Those are avatar sizes Misago generates images for
  13. # Remember to run "genavatars" command when you change this setting!
  14. AVATAR_SIZES = (125, 100, 80, 60, 40, 24)
  15. # Allow usernames to contain diacritics
  16. UNICODE_USERNAMES = True
  17. # If you set this to False, Django will make some optimizations so as not
  18. # to load the internationalization machinery.
  19. USE_I18N = True
  20. # If you set this to False, Django will not format dates, numbers and
  21. # calendars according to the current locale.
  22. USE_L10N = True
  23. # If you set this to False, Django will not use timezone-aware datetimes.
  24. USE_TZ = True
  25. # List of directories that contain Misago locale files
  26. # Defautly set Django to look for Misago translations in misago/locale directory
  27. LOCALE_PATHS = (
  28. ('%slocale%s' % (os.path.dirname(__file__) + os.sep, os.sep)),
  29. )
  30. # Catch-all e-mail address
  31. # If DEBUG_MODE is on, all emails will be sent to this address instead of real recipient.
  32. CATCH_ALL_EMAIL_ADDRESS = ''
  33. # Forums and threads read tracker length (days
  34. # Enter 0 to turn tracking off
  35. # The bigger the number, then longer tracker keeps threads reads
  36. # information and the more costful it is to track reads
  37. READS_TRACKER_LENGTH = 7
  38. # Heartbeat Path for crons
  39. # Use this path if you wish to keep Misago alive using separate cron
  40. # By quering this path from your cron you'll keep Misago's base clean
  41. # Leave empty if you don't use Heartbeat cron
  42. HEARTBEAT_PATH = ''
  43. # List of finder classes that know how to find static files in
  44. # various locations.
  45. STATICFILES_FINDERS = (
  46. 'django.contrib.staticfiles.finders.FileSystemFinder',
  47. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  48. )
  49. # List of callables that know how to import templates from various sources.
  50. TEMPLATE_LOADERS = (
  51. 'django.template.loaders.filesystem.Loader',
  52. 'django.template.loaders.app_directories.Loader',
  53. )
  54. # Context processors
  55. TEMPLATE_CONTEXT_PROCESSORS = (
  56. 'django.core.context_processors.debug',
  57. 'django.core.context_processors.i18n',
  58. 'django.core.context_processors.media',
  59. 'django.core.context_processors.static',
  60. 'django.core.context_processors.tz',
  61. 'django.contrib.messages.context_processors.messages',
  62. 'misago.context_processors.common',
  63. 'misago.context_processors.admin',
  64. )
  65. # Jinja2 Template Extensions
  66. JINJA2_EXTENSIONS = (
  67. 'jinja2.ext.do',
  68. )
  69. # List of application middlewares
  70. MIDDLEWARE_CLASSES = (
  71. 'misago.middleware.stopwatch.StopwatchMiddleware',
  72. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  73. 'misago.middleware.heartbeat.HeartbeatMiddleware',
  74. 'misago.middleware.cookiejar.CookieJarMiddleware',
  75. 'misago.middleware.settings.SettingsMiddleware',
  76. 'misago.middleware.monitor.MonitorMiddleware',
  77. 'misago.middleware.theme.ThemeMiddleware',
  78. 'misago.middleware.firewalls.FirewallMiddleware',
  79. 'misago.middleware.crawlers.DetectCrawlerMiddleware',
  80. 'misago.middleware.session.SessionMiddleware',
  81. 'misago.middleware.bruteforce.JamMiddleware',
  82. 'misago.middleware.csrf.CSRFMiddleware',
  83. 'misago.middleware.banning.BanningMiddleware',
  84. 'misago.middleware.messages.MessagesMiddleware',
  85. 'misago.middleware.user.UserMiddleware',
  86. 'misago.middleware.acl.ACLMiddleware',
  87. 'django.middleware.common.CommonMiddleware',
  88. )
  89. # List of application permission providers
  90. PERMISSION_PROVIDERS = (
  91. 'misago.acl.permissions.admin',
  92. 'misago.acl.permissions.usercp',
  93. 'misago.acl.permissions.users',
  94. 'misago.acl.permissions.forums',
  95. 'misago.acl.permissions.threads',
  96. )
  97. # List of UserCP extensions
  98. USERCP_EXTENSIONS = (
  99. 'misago.apps.usercp.options',
  100. 'misago.apps.usercp.avatar',
  101. 'misago.apps.usercp.signature',
  102. 'misago.apps.usercp.credentials',
  103. 'misago.apps.usercp.username',
  104. )
  105. # List of User Profile extensions
  106. PROFILE_EXTENSIONS = (
  107. 'misago.apps.profiles.posts',
  108. 'misago.apps.profiles.threads',
  109. 'misago.apps.profiles.follows',
  110. 'misago.apps.profiles.followers',
  111. 'misago.apps.profiles.details',
  112. )
  113. # List of Markdown Extensions
  114. MARKDOWN_EXTENSIONS = (
  115. 'misago.markdown.extensions.quotes.QuoteTitlesExtension',
  116. 'misago.markdown.extensions.mentions.MentionsExtension',
  117. 'misago.markdown.extensions.magiclinks.MagicLinksExtension',
  118. )
  119. # Name of root urls configuration
  120. ROOT_URLCONF = 'misago.urls'
  121. #Installed applications
  122. INSTALLED_APPS = (
  123. # Applications that have no dependencies first!
  124. 'south',
  125. 'coffin',
  126. 'django.contrib.staticfiles',
  127. 'django.contrib.humanize',
  128. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  129. 'debug_toolbar', # Debug toolbar
  130. 'misago', # Misago Forum App
  131. )
  132. # Stopwatch target file
  133. STOPWATCH_LOG = ''
  134. # IP's that can see debug toolbar
  135. INTERNAL_IPS = ('127.0.0.1', '::1')
  136. # Debug toolbar config
  137. DEBUG_TOOLBAR_CONFIG = {
  138. 'INTERCEPT_REDIRECTS': False
  139. }
  140. # List panels displayed by toolbar
  141. DEBUG_TOOLBAR_PANELS = (
  142. 'debug_toolbar.panels.timer.TimerDebugPanel',
  143. 'debug_toolbar.panels.sql.SQLDebugPanel',
  144. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  145. 'misago.acl.panels.MisagoACLDebugPanel',
  146. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  147. 'debug_toolbar.panels.template.TemplateDebugPanel',
  148. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  149. 'debug_toolbar.panels.signals.SignalDebugPanel',
  150. 'debug_toolbar.panels.logger.LoggingPanel',
  151. 'debug_toolbar.panels.version.VersionDebugPanel',
  152. )
  153. # Turn off caching
  154. CACHES = {
  155. 'default': {
  156. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  157. }
  158. }
  159. # A sample logging configuration. The only tangible logging
  160. # performed by this configuration is to send an email to
  161. # the site admins on every HTTP 500 error when DEBUG=False.
  162. # See http://docs.djangoproject.com/en/dev/topics/logging for
  163. # more details on how to customize your logging configuration.
  164. LOGGING = {
  165. 'version': 1,
  166. 'disable_existing_loggers': False,
  167. 'filters': {
  168. 'require_debug_false': {
  169. '()': 'django.utils.log.RequireDebugFalse'
  170. }
  171. },
  172. 'handlers': {
  173. 'mail_admins': {
  174. 'level': 'ERROR',
  175. 'filters': ['require_debug_false'],
  176. 'class': 'django.utils.log.AdminEmailHandler'
  177. }
  178. },
  179. 'loggers': {
  180. 'django.request': {
  181. 'handlers': ['mail_admins'],
  182. 'level': 'ERROR',
  183. 'propagate': True,
  184. },
  185. }
  186. }
  187. # Create copy of installed apps list
  188. # South overrides INSTALLED_APPS list with custom one
  189. # that doesn't contain apps without models when it
  190. # runs its own syncdb
  191. # Misago's loaddata command requires complete list of
  192. # installed apps in order to work correctly
  193. import copy
  194. INSTALLED_APPS_COMPLETE = copy.copy(INSTALLED_APPS)