settings_base.py 7.4 KB

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