settings_base.py 8.4 KB

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