settings_base.py 8.4 KB

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