settings_base.py 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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.core',
  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.cookie_jar.middleware.CookieJarMiddleware',
  83. 'misago.settings.middleware.SettingsMiddleware',
  84. 'misago.monitor.middleware.MonitorMiddleware',
  85. 'misago.themes.middleware.ThemeMiddleware',
  86. 'misago.firewalls.middleware.FirewallMiddleware',
  87. 'misago.crawlers.middleware.DetectCrawlerMiddleware',
  88. 'misago.sessions.middleware.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. )
  126. # Name of root urls configuration
  127. ROOT_URLCONF = 'misago.urls'
  128. #Installed applications
  129. INSTALLED_APPS = (
  130. # Applications that have no dependencies first!
  131. 'south',
  132. 'coffin',
  133. 'django.contrib.staticfiles',
  134. 'django.contrib.humanize',
  135. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  136. 'debug_toolbar', # Debug toolbar
  137. 'misago.acl', # ACL Builder and dehydrator
  138. 'misago.settings', # Database level application configuration
  139. 'misago.monitor', # Forum statistics monitor
  140. 'misago.utils', # Utility classes
  141. 'misago.tos', # Terms of Service AKA Guidelines
  142. # Applications with dependencies
  143. 'misago.banning', # Banning and blacklisting users
  144. 'misago.crawlers', # Web crawlers handling
  145. 'misago.cookie_jar', # Cookies helper
  146. 'misago.captcha', # Web crawlers handling
  147. 'misago.forums', # Forums, threads and posts
  148. 'misago.messages', # Messages and Flashes
  149. 'misago.newsletters', # Send newsletters to members from Admin
  150. 'misago.stats', # Admin statistics generator
  151. 'misago.sessions', # Sessions
  152. 'misago.authn', # User authentication
  153. 'misago.bruteforce', # Brute-Force protection
  154. 'misago.csrf', # Cross Site Request Forgery protection
  155. 'misago.setup', # Installation/update tool
  156. 'misago.template', # Templates extensions
  157. 'misago.themes', # Themes
  158. 'misago.users', # Users foundation
  159. 'misago.alerts', # Users Notifications
  160. 'misago.team', # Forum Team List
  161. 'misago.prune', # Prune Users
  162. 'misago.ranks', # User Ranks
  163. 'misago.roles', # User Roles
  164. 'misago.forumroles', # Forum Roles
  165. 'misago.usercp', # User Control Panel
  166. 'misago.profiles', # User Profiles
  167. 'misago.register', # Register New Users
  168. 'misago.activation', # Activate inactive User or resend activation e-mail
  169. 'misago.resetpswd', # Reset User Password
  170. 'misago.threads', # Threads and Posts
  171. 'misago.readstracker', # Forums and Threads reads tracker
  172. 'misago.watcher', # Observe threads
  173. )
  174. # Stopwatch target file
  175. STOPWATCH_LOG = ''
  176. # IP's that can see debug toolbar
  177. INTERNAL_IPS = ('127.0.0.1', '::1')
  178. # Debug toolbar config
  179. DEBUG_TOOLBAR_CONFIG = {
  180. 'INTERCEPT_REDIRECTS': False
  181. }
  182. # List panels displayed by toolbar
  183. DEBUG_TOOLBAR_PANELS = (
  184. 'debug_toolbar.panels.timer.TimerDebugPanel',
  185. 'debug_toolbar.panels.sql.SQLDebugPanel',
  186. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  187. 'misago.acl.panels.MisagoACLDebugPanel',
  188. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  189. 'debug_toolbar.panels.template.TemplateDebugPanel',
  190. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  191. 'debug_toolbar.panels.signals.SignalDebugPanel',
  192. 'debug_toolbar.panels.logger.LoggingPanel',
  193. 'debug_toolbar.panels.version.VersionDebugPanel',
  194. )
  195. # Turn off caching
  196. CACHES = {
  197. 'default': {
  198. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  199. }
  200. }
  201. # A sample logging configuration. The only tangible logging
  202. # performed by this configuration is to send an email to
  203. # the site admins on every HTTP 500 error when DEBUG=False.
  204. # See http://docs.djangoproject.com/en/dev/topics/logging for
  205. # more details on how to customize your logging configuration.
  206. LOGGING = {
  207. 'version': 1,
  208. 'disable_existing_loggers': False,
  209. 'filters': {
  210. 'require_debug_false': {
  211. '()': 'django.utils.log.RequireDebugFalse'
  212. }
  213. },
  214. 'handlers': {
  215. 'mail_admins': {
  216. 'level': 'ERROR',
  217. 'filters': ['require_debug_false'],
  218. 'class': 'django.utils.log.AdminEmailHandler'
  219. }
  220. },
  221. 'loggers': {
  222. 'django.request': {
  223. 'handlers': ['mail_admins'],
  224. 'level': 'ERROR',
  225. 'propagate': True,
  226. },
  227. }
  228. }
  229. # Create copy of installed apps list
  230. # South overrides INSTALLED_APPS list with custom one
  231. # that doesn't contain apps without models when it
  232. # runs its own syncdb
  233. # Misago's loaddata command requires complete list of
  234. # installed apps in order to work correctly
  235. import copy
  236. INSTALLED_APPS_COMPLETE = copy.copy(INSTALLED_APPS)