settings_base.py 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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_jinja.loaders.AppLoader',
  59. 'django_jinja.loaders.FileSystemLoader',
  60. )
  61. # Template extensions that will cause Jinja2 to be used
  62. DEFAULT_JINJA2_TEMPLATE_EXTENSION = ('.html', '.txt')
  63. # Context processors
  64. TEMPLATE_CONTEXT_PROCESSORS = (
  65. 'django.core.context_processors.debug',
  66. 'django.core.context_processors.i18n',
  67. 'django.core.context_processors.media',
  68. 'django.core.context_processors.static',
  69. 'django.core.context_processors.tz',
  70. 'django.contrib.messages.context_processors.messages',
  71. 'misago.context_processors.common',
  72. 'misago.context_processors.admin',
  73. )
  74. # Template middlewares
  75. TEMPLATE_MIDDLEWARES = ()
  76. # Jinja2 Template Extensions
  77. JINJA2_EXTENSIONS = (
  78. 'jinja2.ext.do',
  79. )
  80. # Turn autoescape on
  81. JINJA2_AUTOESCAPE = True
  82. # List of application middlewares
  83. MIDDLEWARE_CLASSES = (
  84. 'misago.middleware.threading.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. 'mptt', # Modified Pre-order Tree Transversal - allows us to nest forums
  157. 'haystack', # Search engines bridge
  158. 'debug_toolbar', # Debug toolbar'
  159. 'misago', # Misago Forum App
  160. )
  161. # Stopwatch target file
  162. STOPWATCH_LOG = ''
  163. # IP's that can see debug toolbar
  164. INTERNAL_IPS = ('127.0.0.1', '::1')
  165. # Debug toolbar config
  166. DEBUG_TOOLBAR_CONFIG = {
  167. 'INTERCEPT_REDIRECTS': False
  168. }
  169. # List panels displayed by toolbar
  170. DEBUG_TOOLBAR_PANELS = (
  171. 'debug_toolbar.panels.timer.TimerDebugPanel',
  172. 'debug_toolbar.panels.sql.SQLDebugPanel',
  173. 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
  174. 'misago.acl.panels.MisagoACLDebugPanel',
  175. 'debug_toolbar.panels.headers.HeaderDebugPanel',
  176. 'debug_toolbar.panels.template.TemplateDebugPanel',
  177. 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
  178. 'debug_toolbar.panels.signals.SignalDebugPanel',
  179. 'debug_toolbar.panels.logger.LoggingPanel',
  180. 'debug_toolbar.panels.version.VersionDebugPanel',
  181. )
  182. # Turn off caching
  183. CACHES = {
  184. 'default': {
  185. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  186. }
  187. }
  188. # A sample logging configuration. The only tangible logging
  189. # performed by this configuration is to send an email to
  190. # the site admins on every HTTP 500 error when DEBUG=False.
  191. # See http://docs.djangoproject.com/en/dev/topics/logging for
  192. # more details on how to customize your logging configuration.
  193. LOGGING = {
  194. 'version': 1,
  195. 'disable_existing_loggers': False,
  196. 'filters': {
  197. 'require_debug_false': {
  198. '()': 'django.utils.log.RequireDebugFalse'
  199. }
  200. },
  201. 'handlers': {
  202. 'mail_admins': {
  203. 'level': 'ERROR',
  204. 'filters': ['require_debug_false'],
  205. 'class': 'django.utils.log.AdminEmailHandler'
  206. }
  207. },
  208. 'loggers': {
  209. 'django.request': {
  210. 'handlers': ['mail_admins'],
  211. 'level': 'ERROR',
  212. 'propagate': True,
  213. },
  214. }
  215. }
  216. # Create copy of installed apps list
  217. # South overrides INSTALLED_APPS list with custom one
  218. # that doesn't contain apps without models when it
  219. # runs its own syncdb
  220. # Misago's loaddata command requires complete list of
  221. # installed apps in order to work correctly
  222. import copy
  223. INSTALLED_APPS_COMPLETE = copy.copy(INSTALLED_APPS)