settings_base.py 8.0 KB

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