defaults.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. 'misago.admin.middleware.AdminAuthMiddleware',
  76. )
  77. TEMPLATE_CONTEXT_PROCESSORS = (
  78. 'django.contrib.auth.context_processors.auth',
  79. 'django.core.context_processors.debug',
  80. 'django.core.context_processors.i18n',
  81. 'django.core.context_processors.media',
  82. 'django.core.context_processors.static',
  83. 'django.core.context_processors.tz',
  84. 'django.contrib.messages.context_processors.messages',
  85. 'misago.core.context_processors.site_address',
  86. 'misago.conf.context_processors.settings',
  87. )
  88. # Register Misago directories
  89. LOCALE_PATHS = (
  90. os.path.join(MISAGO_BASE_DIR, 'locale'),
  91. )
  92. STATICFILES_DIRS = (
  93. os.path.join(MISAGO_BASE_DIR, 'static'),
  94. )
  95. TEMPLATE_DIRS = (
  96. os.path.join(MISAGO_BASE_DIR, 'templates'),
  97. )
  98. # Internationalization
  99. USE_I18N = True
  100. USE_L10N = True
  101. USE_TZ = True
  102. TIME_ZONE = 'UTC'
  103. # Use Misago CSRF Failure Page
  104. CSRF_FAILURE_VIEW = 'misago.core.errorpages.csrf_failure'
  105. # Use Misago authentication
  106. AUTH_USER_MODEL = 'users.User'
  107. AUTHENTICATION_BACKENDS = (
  108. 'misago.users.authbackends.MisagoBackend',
  109. )
  110. # How many e-mails should be sent in single step.
  111. # This is used for conserving memory usage when mailing many users at same time
  112. MISAGO_MAILER_BATCH_SIZE = 20
  113. # Auth paths
  114. LOGIN_REDIRECT_URL = 'misago:index'
  115. LOGIN_URL = 'misago:login'
  116. LOGOUT_URL = 'misago:logout'
  117. # Misago Admin Path
  118. # Omit starting and trailing slashes
  119. # To disable Misago admin, empty this value
  120. MISAGO_ADMIN_PATH = 'admincp'
  121. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  122. MISAGO_ADMIN_NAMESPACES = (
  123. 'admin',
  124. 'misago:admin',
  125. )