default.py 2.4 KB

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