defaults.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. """
  2. Misago default settings
  3. This fille sets everything Misago needs to run.
  4. If you want to add custom app, middleware or path, please update setting vallue
  5. defined in this file instead of copying setting from here to your settings.py.
  6. Yes:
  7. #yourproject/settings.py
  8. INSTALLED_APPS += (
  9. 'myawesomeapp',
  10. )
  11. No:
  12. #yourproject/settings.py
  13. INSTALLED_APPS = (
  14. 'django.contrib.admin',
  15. 'django.contrib.auth',
  16. 'misago.core',
  17. 'misago.conf',
  18. ...
  19. 'myawesomeapp',
  20. )
  21. """
  22. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  23. import os
  24. MISAGO_BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  25. # Assets Pipeline
  26. # See http://django-pipeline.readthedocs.org/en/latest/configuration.html
  27. PIPELINE_CSS = {
  28. 'misago': {
  29. 'source_filenames': (
  30. 'misago/css/style.less',
  31. ),
  32. 'output_filename': 'misago.css',
  33. },
  34. }
  35. PIPELINE_JS = {
  36. 'misago': {
  37. 'source_filenames': (
  38. 'misago/js/jquery.js',
  39. 'misago/js/bootstrap.js',
  40. ),
  41. 'output_filename': 'misago.js',
  42. }
  43. }
  44. STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
  45. PIPELINE_COMPILERS = (
  46. 'pipeline.compilers.less.LessCompiler',
  47. )
  48. PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
  49. PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
  50. # Application definition
  51. INSTALLED_APPS = (
  52. 'django.contrib.admin',
  53. 'django.contrib.auth',
  54. 'django.contrib.contenttypes',
  55. 'django.contrib.sessions',
  56. 'django.contrib.messages',
  57. 'django.contrib.staticfiles',
  58. 'debug_toolbar',
  59. 'south',
  60. 'pipeline',
  61. 'floppyforms',
  62. 'misago.core',
  63. 'misago.conf',
  64. 'misago.users',
  65. )
  66. MIDDLEWARE_CLASSES = (
  67. 'django.contrib.sessions.middleware.SessionMiddleware',
  68. 'django.middleware.common.CommonMiddleware',
  69. 'django.middleware.csrf.CsrfViewMiddleware',
  70. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  71. 'django.contrib.messages.middleware.MessageMiddleware',
  72. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  73. 'misago.core.middleware.threadstore.ThreadStoreMiddleware',
  74. 'misago.core.middleware.exceptionhandler.ExceptionHandlerMiddleware',
  75. )
  76. TEMPLATE_CONTEXT_PROCESSORS = (
  77. 'django.contrib.auth.context_processors.auth',
  78. 'django.core.context_processors.debug',
  79. 'django.core.context_processors.i18n',
  80. 'django.core.context_processors.media',
  81. 'django.core.context_processors.static',
  82. 'django.core.context_processors.tz',
  83. 'django.contrib.messages.context_processors.messages',
  84. 'misago.core.context_processors.site_address',
  85. 'misago.conf.context_processors.settings',
  86. )
  87. # Register Misago directories
  88. LOCALE_PATHS = (
  89. os.path.join(MISAGO_BASE_DIR, 'locale'),
  90. )
  91. STATICFILES_DIRS = (
  92. os.path.join(MISAGO_BASE_DIR, 'static'),
  93. )
  94. TEMPLATE_DIRS = (
  95. os.path.join(MISAGO_BASE_DIR, 'templates'),
  96. )
  97. # Internationalization
  98. USE_I18N = True
  99. USE_L10N = True
  100. USE_TZ = True
  101. TIME_ZONE = 'UTC'
  102. # Use Misago CSRF Failure Page
  103. CSRF_FAILURE_VIEW = 'misago.core.errorpages.csrf_failure'
  104. # Use Misago authentication
  105. AUTH_USER_MODEL = 'users.User'
  106. AUTHENTICATION_BACKENDS = (
  107. 'misago.users.authbackends.MisagoBackend',
  108. )
  109. # How many e-mails should be sent in single step.
  110. # This is used for conserving memory usage when mailing many users at same time
  111. MISAGO_MAILER_BATCH_SIZE = 20