settings_base.py 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. # Min. number of days between synchronisating member profiles
  39. # Allows you to keep your member profiles up to date, enter 0 to never sync
  40. PROFILES_SYNC_FREQUENCY = 7
  41. # Heartbeat Path for crons
  42. # Use this path if you wish to keep Misago alive using separate cron
  43. # By quering this path from your cron you'll keep Misago's base clean
  44. # Leave empty if you don't use Heartbeat cron
  45. HEARTBEAT_PATH = ''
  46. # List of finder classes that know how to find static files in
  47. # various locations.
  48. STATICFILES_FINDERS = (
  49. 'django.contrib.staticfiles.finders.FileSystemFinder',
  50. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  51. )
  52. # List of callables that know how to import templates from various sources.
  53. TEMPLATE_LOADERS = (
  54. 'django.template.loaders.filesystem.Loader',
  55. 'django.template.loaders.app_directories.Loader',
  56. )
  57. # Context processors
  58. TEMPLATE_CONTEXT_PROCESSORS = (
  59. 'django.core.context_processors.debug',
  60. 'django.core.context_processors.i18n',
  61. 'django.core.context_processors.media',
  62. 'django.core.context_processors.static',
  63. 'django.core.context_processors.tz',
  64. 'django.contrib.messages.context_processors.messages',
  65. 'misago.context_processors.common',
  66. 'misago.context_processors.admin',
  67. )
  68. # Jinja2 Template Extensions
  69. JINJA2_EXTENSIONS = (
  70. 'jinja2.ext.do',
  71. )
  72. # List of application middlewares
  73. MIDDLEWARE_CLASSES = (
  74. 'misago.middleware.stopwatch.StopwatchMiddleware',
  75. 'misago.middleware.heartbeat.HeartbeatMiddleware',
  76. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  77. 'misago.middleware.cookiejar.CookieJarMiddleware',
  78. 'misago.middleware.settings.SettingsMiddleware',
  79. 'misago.middleware.monitor.MonitorMiddleware',
  80. 'misago.middleware.theme.ThemeMiddleware',
  81. 'misago.middleware.firewalls.FirewallMiddleware',
  82. 'misago.middleware.crawlers.DetectCrawlerMiddleware',
  83. 'misago.middleware.session.SessionMiddleware',
  84. 'misago.middleware.bruteforce.JamMiddleware',
  85. 'misago.middleware.csrf.CSRFMiddleware',
  86. 'misago.middleware.banning.BanningMiddleware',
  87. 'misago.middleware.messages.MessagesMiddleware',
  88. 'misago.middleware.user.UserMiddleware',
  89. 'misago.middleware.mailsqueue.MailsQueueMiddleware',
  90. 'misago.middleware.acl.ACLMiddleware',
  91. 'misago.middleware.privatethreads.PrivateThreadsMiddleware',
  92. 'django.middleware.common.CommonMiddleware',
  93. )
  94. # List of application permission providers
  95. PERMISSION_PROVIDERS = (
  96. 'misago.acl.permissions.usercp',
  97. 'misago.acl.permissions.users',
  98. 'misago.acl.permissions.forums',
  99. 'misago.acl.permissions.threads',
  100. 'misago.acl.permissions.privatethreads',
  101. 'misago.acl.permissions.special',
  102. )
  103. # List of UserCP extensions
  104. USERCP_EXTENSIONS = (
  105. 'misago.apps.usercp.options',
  106. 'misago.apps.usercp.avatar',
  107. 'misago.apps.usercp.signature',
  108. 'misago.apps.usercp.credentials',
  109. 'misago.apps.usercp.username',
  110. )
  111. # List of User Profile extensions
  112. PROFILE_EXTENSIONS = (
  113. 'misago.apps.profiles.posts',
  114. 'misago.apps.profiles.threads',
  115. 'misago.apps.profiles.follows',
  116. 'misago.apps.profiles.followers',
  117. 'misago.apps.profiles.details',
  118. )
  119. # List of Markdown Extensions
  120. MARKDOWN_EXTENSIONS = (
  121. 'misago.markdown.extensions.strikethrough.StrikethroughExtension',
  122. 'misago.markdown.extensions.quotes.QuoteTitlesExtension',
  123. 'misago.markdown.extensions.mentions.MentionsExtension',
  124. 'misago.markdown.extensions.magiclinks.MagicLinksExtension',
  125. 'misago.markdown.extensions.cleanlinks.CleanLinksExtension',
  126. # Uncomment for EXPERIMENTAL BBCode support
  127. #'misago.markdown.extensions.bbcodes.BBCodesExtension',
  128. # Uncomment for emoji support, requires emoji directory in static dir.
  129. #'misago.markdown.extensions.emoji.EmojiExtension',
  130. )
  131. # Name of root urls configuration
  132. ROOT_URLCONF = 'misago.urls'
  133. #Installed applications
  134. INSTALLED_APPS = (
  135. # Applications that have no dependencies first!
  136. 'south',
  137. 'coffin',
  138. 'django.contrib.staticfiles',
  139. 'django.contrib.humanize',
  140. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  141. 'debug_toolbar', # Debug toolbar
  142. 'misago', # Misago Forum App
  143. )
  144. # Stopwatch target file
  145. STOPWATCH_LOG = ''
  146. # IP's that can see debug toolbar
  147. INTERNAL_IPS = ('127.0.0.1', '::1')
  148. # Debug toolbar config
  149. DEBUG_TOOLBAR_CONFIG = {
  150. 'INTERCEPT_REDIRECTS': False
  151. }
  152. # List panels displayed by toolbar
  153. DEBUG_TOOLBAR_PANELS = (
  154. 'debug_toolbar.panels.timer.TimerDebugPanel',
  155. 'debug_toolbar.panels.sql.SQLDebugPanel',
  156. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  157. 'misago.acl.panels.MisagoACLDebugPanel',
  158. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  159. 'debug_toolbar.panels.template.TemplateDebugPanel',
  160. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  161. 'debug_toolbar.panels.signals.SignalDebugPanel',
  162. 'debug_toolbar.panels.logger.LoggingPanel',
  163. 'debug_toolbar.panels.version.VersionDebugPanel',
  164. )
  165. # Turn off caching
  166. CACHES = {
  167. 'default': {
  168. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  169. }
  170. }
  171. # A sample logging configuration. The only tangible logging
  172. # performed by this configuration is to send an email to
  173. # the site admins on every HTTP 500 error when DEBUG=False.
  174. # See http://docs.djangoproject.com/en/dev/topics/logging for
  175. # more details on how to customize your logging configuration.
  176. LOGGING = {
  177. 'version': 1,
  178. 'disable_existing_loggers': False,
  179. 'filters': {
  180. 'require_debug_false': {
  181. '()': 'django.utils.log.RequireDebugFalse'
  182. }
  183. },
  184. 'handlers': {
  185. 'mail_admins': {
  186. 'level': 'ERROR',
  187. 'filters': ['require_debug_false'],
  188. 'class': 'django.utils.log.AdminEmailHandler'
  189. }
  190. },
  191. 'loggers': {
  192. 'django.request': {
  193. 'handlers': ['mail_admins'],
  194. 'level': 'ERROR',
  195. 'propagate': True,
  196. },
  197. }
  198. }
  199. # Create copy of installed apps list
  200. # South overrides INSTALLED_APPS list with custom one
  201. # that doesn't contain apps without models when it
  202. # runs its own syncdb
  203. # Misago's loaddata command requires complete list of
  204. # installed apps in order to work correctly
  205. import copy
  206. INSTALLED_APPS_COMPLETE = copy.copy(INSTALLED_APPS)