default.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # -*- coding: utf-8 -*-
  2. """
  3. flaskbb.configs.default
  4. ~~~~~~~~~~~~~~~~~~~~~~~
  5. This is the default configuration for FlaskBB that every site should have.
  6. You can override these configuration variables in another class.
  7. :copyright: (c) 2014 by the FlaskBB Team.
  8. :license: BSD, see LICENSE for more details.
  9. """
  10. import os
  11. import sys
  12. _VERSION_STR = '{0.major}{0.minor}'.format(sys.version_info)
  13. class DefaultConfig(object):
  14. # Get the app root path
  15. # <_basedir>
  16. # ../../ --> flaskbb/flaskbb/configs/base.py
  17. _basedir = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(
  18. os.path.dirname(__file__)))))
  19. DEBUG = False
  20. TESTING = False
  21. # Logs
  22. # If SEND_LOGS is set to True, the admins (see the mail configuration) will
  23. # recieve the error logs per email.
  24. SEND_LOGS = False
  25. # The filename for the info and error logs. The logfiles are stored at
  26. # flaskbb/logs
  27. INFO_LOG = "info.log"
  28. ERROR_LOG = "error.log"
  29. # Default Database
  30. SQLALCHEMY_DATABASE_URI = 'sqlite:///' + _basedir + '/' + \
  31. 'flaskbb.sqlite'
  32. # This will print all SQL statements
  33. SQLALCHEMY_ECHO = False
  34. # Security
  35. # This is the secret key that is used for session signing.
  36. # You can generate a secure key with os.urandom(24)
  37. SECRET_KEY = 'secret key'
  38. # Protection against form post fraud
  39. WTF_CSRF_ENABLED = True
  40. WTF_CSRF_SECRET_KEY = "reallyhardtoguess"
  41. # Searching
  42. WHOOSH_BASE = os.path.join(_basedir, "whoosh_index", _VERSION_STR)
  43. # Auth
  44. LOGIN_VIEW = "auth.login"
  45. REAUTH_VIEW = "auth.reauth"
  46. LOGIN_MESSAGE_CATEGORY = "error"
  47. # Caching
  48. CACHE_TYPE = "simple"
  49. CACHE_DEFAULT_TIMEOUT = 60
  50. ## Captcha
  51. RECAPTCHA_ENABLED = False
  52. RECAPTCHA_USE_SSL = False
  53. RECAPTCHA_PUBLIC_KEY = "your_public_recaptcha_key"
  54. RECAPTCHA_PRIVATE_KEY = "your_private_recaptcha_key"
  55. RECAPTCHA_OPTIONS = {"theme": "white"}
  56. ## Mail
  57. MAIL_SERVER = "localhost"
  58. MAIL_PORT = 25
  59. MAIL_USE_SSL = False
  60. MAIL_USE_TLS = False
  61. MAIL_USERNAME = "noreply@example.org"
  62. MAIL_PASSWORD = ""
  63. MAIL_DEFAULT_SENDER = ("Default Sender", "noreply@example.org")
  64. # Where to logger should send the emails to
  65. ADMINS = ["admin@example.org"]
  66. # Flask-Redis
  67. REDIS_ENABLED = False
  68. REDIS_URL = "redis://:password@localhost:6379"
  69. REDIS_DATABASE = 0
  70. # URL Prefixes
  71. FORUM_URL_PREFIX = ""
  72. USER_URL_PREFIX = "/user"
  73. MESSAGE_URL_PREFIX = "/message"
  74. AUTH_URL_PREFIX = "/auth"
  75. ADMIN_URL_PREFIX = "/admin"