123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- """
- Misago default settings
- This fille sets everything Misago needs to run.
- If you want to add custom app, middleware or path, please update setting vallue
- defined in this file instead of copying setting from here to your settings.py.
- Yes:
- #yourproject/settings.py
- INSTALLED_APPS += (
- 'myawesomeapp',
- )
- No:
- #yourproject/settings.py
- INSTALLED_APPS = (
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'misago.core',
- 'misago.conf',
- ...
- 'myawesomeapp',
- )
- """
- # Build paths inside the project like this: os.path.join(MISAGO_BASE_DIR, ...)
- import os
- MISAGO_BASE_DIR = os.path.dirname(os.path.dirname(__file__))
- # Assets Pipeline
- # See http://django-pipeline.readthedocs.org/en/latest/configuration.html
- PIPELINE_CSS = {
- 'misago': {
- 'source_filenames': (
- 'misago/css/style.less',
- ),
- 'output_filename': 'misago.css',
- },
- 'misago_admin': {
- 'source_filenames': (
- 'misago/admin/css/style.less',
- ),
- 'output_filename': 'misago_admin.css',
- },
- }
- PIPELINE_JS = {
- 'misago_lib': {
- 'source_filenames': (
- # leave this part empty, its overrided by deployment's settings.py
- ),
- 'output_filename': 'misago_lib.js',
- },
- 'misago': {
- 'source_filenames': (
- 'misago/js/templates/*.hbs',
- 'misago/js/application.js',
- 'misago/js/router.js',
- ),
- 'output_filename': 'misago.js',
- },
- 'misago_editor': {
- 'source_filenames': (
- 'misago/js/jquery.autosize.js',
- 'misago/js/misago-editor.js',
- ),
- 'output_filename': 'misago-editor.js',
- },
- 'misago_admin': {
- 'source_filenames': (
- 'misago/admin/js/jquery.js',
- 'misago/admin/js/bootstrap.js',
- 'misago/admin/js/moment.min.js',
- 'misago/admin/js/bootstrap-datetimepicker.min.js',
- 'misago/admin/js/misago-datetimepicker.js',
- 'misago/admin/js/misago-timestamps.js',
- 'misago/admin/js/misago-tooltips.js',
- 'misago/admin/js/misago-tables.js',
- 'misago/admin/js/misago-yesnoswitch.js',
- ),
- 'output_filename': 'misago_admin.js',
- },
- }
- MISAGO_JS_LIB_DEV = (
- 'misago/ember/jquery-1.11.1.min.js',
- 'misago/ember/handlebars-v2.0.0.js',
- 'misago/ember/ember-1.9.1.js',
- 'misago/ember/ember-data-1.0.0.b14.js',
- )
- MISAGO_JS_LIB_PROD = (
- 'misago/ember/jquery-1.11.1.min.js',
- 'misago/ember/handlebars.runtime-v2.0.0.js',
- 'misago/ember/ember.prod-1.9.1.js',
- 'misago/ember/ember-data.prod-1.0.0.b14.js',
- )
- PIPELINE_COMPILERS = (
- 'pipeline.compilers.less.LessCompiler',
- )
- PIPELINE_TEMPLATE_EXT = '.hbs'
- PIPELINE_TEMPLATE_FUNC = 'Ember.Handlebars.compile'
- PIPELINE_TEMPLATE_NAMESPACE = 'window.Ember.TEMPLATES'
- PIPELINE_TEMPLATE_SEPARATOR = '/'
- PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
- PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
- STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- 'pipeline.finders.PipelineFinder',
- )
- STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
- # Application definition
- INSTALLED_APPS = (
- 'django.contrib.admin',
- # Keep misago.users above django.contrib.auth
- # so our management commands take precedence over theirs
- 'misago.users',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'django.contrib.humanize',
- 'debug_toolbar',
- 'pipeline',
- 'crispy_forms',
- 'mptt',
- 'rest_framework',
- 'misago.admin',
- 'misago.acl',
- 'misago.core',
- 'misago.conf',
- 'misago.markup',
- 'misago.notifications',
- 'misago.legal',
- 'misago.forums',
- 'misago.threads',
- 'misago.readtracker',
- 'misago.faker',
- )
- MIDDLEWARE_CLASSES = (
- 'misago.users.middleware.AvatarServerMiddleware',
- 'misago.users.middleware.RealIPMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
- 'misago.users.middleware.UserMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'misago.core.middleware.exceptionhandler.ExceptionHandlerMiddleware',
- 'misago.users.middleware.OnlineTrackerMiddleware',
- 'misago.admin.middleware.AdminAuthMiddleware',
- 'misago.threads.middleware.UnreadThreadsCountMiddleware',
- 'misago.core.middleware.threadstore.ThreadStoreMiddleware',
- )
- TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.debug',
- 'django.core.context_processors.i18n',
- 'django.core.context_processors.media',
- 'django.core.context_processors.static',
- 'django.core.context_processors.tz',
- 'django.contrib.messages.context_processors.messages',
- 'misago.core.context_processors.site_address',
- 'misago.conf.context_processors.settings',
- 'misago.users.context_processors.sites_links',
- )
- MISAGO_ACL_EXTENSIONS = (
- 'misago.users.permissions.account',
- 'misago.users.permissions.profiles',
- 'misago.users.permissions.warnings',
- 'misago.users.permissions.moderation',
- 'misago.users.permissions.delete',
- 'misago.forums.permissions',
- 'misago.threads.permissions.threads',
- 'misago.threads.permissions.privatethreads',
- )
- MISAGO_MARKUP_EXTENSIONS = ()
- MISAGO_POSTING_MIDDLEWARES = (
- # Note: always keep FloodProtectionMiddleware middleware first one
- 'misago.threads.posting.floodprotection.FloodProtectionMiddleware',
- 'misago.threads.posting.reply.ReplyFormMiddleware',
- 'misago.threads.posting.participants.ThreadParticipantsFormMiddleware',
- 'misago.threads.posting.threadlabel.ThreadLabelFormMiddleware',
- 'misago.threads.posting.threadpin.ThreadPinFormMiddleware',
- 'misago.threads.posting.threadclose.ThreadCloseFormMiddleware',
- 'misago.threads.posting.recordedit.RecordEditMiddleware',
- 'misago.threads.posting.updatestats.UpdateStatsMiddleware',
- # Note: always keep SaveChangesMiddleware middleware last one
- 'misago.threads.posting.savechanges.SaveChangesMiddleware',
- )
- MISAGO_THREAD_TYPES = (
- # category and redirect types
- 'misago.forums.forumtypes.RootCategory',
- 'misago.forums.forumtypes.Category',
- 'misago.forums.forumtypes.Redirect',
- # real thread types
- 'misago.threads.threadtypes.forumthread.ForumThread',
- 'misago.threads.threadtypes.privatethread.PrivateThread',
- 'misago.threads.threadtypes.report.Report',
- )
- # Register Misago directories
- LOCALE_PATHS = (
- os.path.join(MISAGO_BASE_DIR, 'locale'),
- )
- STATICFILES_DIRS = (
- os.path.join(MISAGO_BASE_DIR, 'static'),
- )
- TEMPLATE_DIRS = (
- os.path.join(MISAGO_BASE_DIR, 'templates'),
- )
- # Internationalization
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- TIME_ZONE = 'UTC'
- # Misago specific date formats
- # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
- MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH = 'j M'
- MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH_YEAR = 'M \'y'
- # Use Misago CSRF Failure Page
- CSRF_FAILURE_VIEW = 'misago.core.errorpages.csrf_failure'
- # Use Misago authentication
- AUTH_USER_MODEL = 'misago_users.User'
- AUTHENTICATION_BACKENDS = (
- 'misago.users.authbackends.MisagoBackend',
- )
- MISAGO_NEW_REGISTRATIONS_VALIDATORS = (
- 'misago.users.validators.validate_gmail_email',
- 'misago.users.validators.validate_with_sfs',
- )
- MISAGO_STOP_FORUM_SPAM_USE = True
- MISAGO_STOP_FORUM_SPAM_MIN_CONFIDENCE = 80
- # How many e-mails should be sent in single step.
- # This is used for conserving memory usage when mailing many users at same time
- MISAGO_MAILER_BATCH_SIZE = 20
- # Auth paths
- LOGIN_REDIRECT_URL = 'misago:index'
- LOGIN_URL = 'misago:login'
- LOGOUT_URL = 'misago:logout'
- # Misago Admin Path
- # Omit starting and trailing slashes
- # To disable Misago admin, empty this value
- MISAGO_ADMIN_PATH = 'admincp'
- # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
- MISAGO_ADMIN_NAMESPACES = (
- 'admin',
- 'misago:admin',
- )
- # How long (in minutes) since previous request to admin namespace should
- # admin session last.
- MISAGO_ADMIN_SESSION_EXPIRATION = 60
- # Max age of notifications in days
- # Notifications older than this are deleted
- # On very active forums its better to keep this smaller
- MISAGO_NOTIFICATIONS_MAX_AGE = 40
- # Fail-safe limits in case forum is raided by spambot
- # No user may exceed those limits, however you may disable
- # them by changing them to 0
- MISAGO_DIALY_POST_LIMIT = 600
- MISAGO_HOURLY_POST_LIMIT = 100
- # Function used for generating individual avatar for user
- MISAGO_DYNAMIC_AVATAR_DRAWER = 'misago.users.avatars.dynamic.draw_default'
- # For which sizes avatars should be cached?
- # Keep sizes ordered from greatest to smallest
- MISAGO_AVATARS_SIZES = (400, 200, 150, 100, 64, 50, 30, 20)
- # Path to avatar server
- # This path is used to detect avatar requests, which bypass most of
- # Request/Response processing for performance reasons
- MISAGO_AVATAR_SERVER_PATH = '/user-avatar'
- # Number of posts displayed on single thread page
- MISAGO_POSTS_PER_PAGE = 15
- MISAGO_THREAD_TAIL = 7
- # Controls max age in days of items that Misago has to process to make rankings
- # Used for active posters and most liked users lists
- # If your forum runs out of memory when trying to generate users rankings list
- # or you want those to be more dynamic, give this setting lower value
- # You don't have to be overzelous with this as user rankings are cached for 24h
- MISAGO_RANKING_LENGTH = 30
- # Controls max number of items displayed on ranked lists
- MISAGO_RANKING_SIZE = 30
- # Controls amount of data used for new threads/replies lists
- # Only unread threads younger than number of days specified in this setting
- # will be considered fresh for "new threads" list
- # Only unread threads with last reply younger than number of days specified
- # there will be confidered fresh for "Threads with unread replies" list
- MISAGO_FRESH_CONTENT_PERIOD = 40
- # Number of minutes between updates of new content counts like new threads,
- # unread replies or moderated threads/posts
- MISAGO_CONTENT_COUNTING_FREQUENCY = 5
- # X-Sendfile
- # X-Sendfile is feature provided by Http servers that allows web apps to
- # delegate serving files over to the better performing server instead of
- # doing it within app.
- # If your server supports X-Sendfile or its variation, enter header name here.
- # For example if you are using Nginx with X-accel enabled, set this setting
- # to "X-Accel-Redirect".
- # Leave this setting empty to Django fallback instead
- MISAGO_SENDFILE_HEADER = ''
- # Allows you to use location feature of your Http server
- # For example, if you have internal location /mymisago/avatar_cache/
- # that points at /home/myweb/misagoforum/avatar_cache/, set this setting
- # to "mymisago".
- MISAGO_SENDFILE_LOCATIONS_PATH = ''
- # Default forms templates
- CRISPY_TEMPLATE_PACK = 'bootstrap3'
- # Register Misago debug panels
- DEBUG_TOOLBAR_PANELS = (
- 'debug_toolbar.panels.versions.VersionsPanel',
- 'debug_toolbar.panels.timer.TimerPanel',
- 'debug_toolbar.panels.settings.SettingsPanel',
- 'debug_toolbar.panels.headers.HeadersPanel',
- 'debug_toolbar.panels.request.RequestPanel',
- 'debug_toolbar.panels.sql.SQLPanel',
- 'misago.acl.panels.MisagoACLPanel',
- 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
- 'debug_toolbar.panels.templates.TemplatesPanel',
- 'debug_toolbar.panels.cache.CachePanel',
- 'debug_toolbar.panels.signals.SignalsPanel',
- 'debug_toolbar.panels.logging.LoggingPanel',
- )
|