settings_base.py 7.9 KB

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