settings_base.py 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. 'misago.middleware.heartbeat.HeartbeatMiddleware',
  73. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  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.usercp',
  92. 'misago.acl.permissions.users',
  93. 'misago.acl.permissions.forums',
  94. 'misago.acl.permissions.threads',
  95. 'misago.acl.permissions.privatethreads',
  96. 'misago.acl.permissions.special',
  97. )
  98. # List of UserCP extensions
  99. USERCP_EXTENSIONS = (
  100. 'misago.apps.usercp.options',
  101. 'misago.apps.usercp.avatar',
  102. 'misago.apps.usercp.signature',
  103. 'misago.apps.usercp.credentials',
  104. 'misago.apps.usercp.username',
  105. )
  106. # List of User Profile extensions
  107. PROFILE_EXTENSIONS = (
  108. 'misago.apps.profiles.posts',
  109. 'misago.apps.profiles.threads',
  110. 'misago.apps.profiles.follows',
  111. 'misago.apps.profiles.followers',
  112. 'misago.apps.profiles.details',
  113. )
  114. # List of Markdown Extensions
  115. MARKDOWN_EXTENSIONS = (
  116. 'misago.markdown.extensions.quotes.QuoteTitlesExtension',
  117. 'misago.markdown.extensions.mentions.MentionsExtension',
  118. 'misago.markdown.extensions.magiclinks.MagicLinksExtension',
  119. )
  120. # Name of root urls configuration
  121. ROOT_URLCONF = 'misago.urls'
  122. #Installed applications
  123. INSTALLED_APPS = (
  124. # Applications that have no dependencies first!
  125. 'south',
  126. 'coffin',
  127. 'django.contrib.staticfiles',
  128. 'django.contrib.humanize',
  129. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  130. 'debug_toolbar', # Debug toolbar
  131. 'misago', # Misago Forum App
  132. )
  133. # Stopwatch target file
  134. STOPWATCH_LOG = ''
  135. # IP's that can see debug toolbar
  136. INTERNAL_IPS = ('127.0.0.1', '::1')
  137. # Debug toolbar config
  138. DEBUG_TOOLBAR_CONFIG = {
  139. 'INTERCEPT_REDIRECTS': False
  140. }
  141. # List panels displayed by toolbar
  142. DEBUG_TOOLBAR_PANELS = (
  143. 'debug_toolbar.panels.timer.TimerDebugPanel',
  144. 'debug_toolbar.panels.sql.SQLDebugPanel',
  145. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  146. 'misago.acl.panels.MisagoACLDebugPanel',
  147. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  148. 'debug_toolbar.panels.template.TemplateDebugPanel',
  149. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  150. 'debug_toolbar.panels.signals.SignalDebugPanel',
  151. 'debug_toolbar.panels.logger.LoggingPanel',
  152. 'debug_toolbar.panels.version.VersionDebugPanel',
  153. )
  154. # Turn off caching
  155. CACHES = {
  156. 'default': {
  157. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  158. }
  159. }
  160. # A sample logging configuration. The only tangible logging
  161. # performed by this configuration is to send an email to
  162. # the site admins on every HTTP 500 error when DEBUG=False.
  163. # See http://docs.djangoproject.com/en/dev/topics/logging for
  164. # more details on how to customize your logging configuration.
  165. LOGGING = {
  166. 'version': 1,
  167. 'disable_existing_loggers': False,
  168. 'filters': {
  169. 'require_debug_false': {
  170. '()': 'django.utils.log.RequireDebugFalse'
  171. }
  172. },
  173. 'handlers': {
  174. 'mail_admins': {
  175. 'level': 'ERROR',
  176. 'filters': ['require_debug_false'],
  177. 'class': 'django.utils.log.AdminEmailHandler'
  178. }
  179. },
  180. 'loggers': {
  181. 'django.request': {
  182. 'handlers': ['mail_admins'],
  183. 'level': 'ERROR',
  184. 'propagate': True,
  185. },
  186. }
  187. }
  188. # Create copy of installed apps list
  189. # South overrides INSTALLED_APPS list with custom one
  190. # that doesn't contain apps without models when it
  191. # runs its own syncdb
  192. # Misago's loaddata command requires complete list of
  193. # installed apps in order to work correctly
  194. import copy
  195. INSTALLED_APPS_COMPLETE = copy.copy(INSTALLED_APPS)