default.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. # sqlite for testing/debug.
  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. # Auth
  40. LOGIN_VIEW = "auth.login"
  41. REAUTH_VIEW = "auth.reauth"
  42. LOGIN_MESSAGE_CATEGORY = "error"
  43. # Caching
  44. CACHE_TYPE = "simple"
  45. CACHE_DEFAULT_TIMEOUT = 60
  46. ## Captcha
  47. RECAPTCHA_ENABLED = False
  48. RECAPTCHA_USE_SSL = False
  49. RECAPTCHA_PUBLIC_KEY = "your_public_recaptcha_key"
  50. RECAPTCHA_PRIVATE_KEY = "your_private_recaptcha_key"
  51. RECAPTCHA_OPTIONS = {"theme": "white"}
  52. ## Mail
  53. MAIL_SERVER = "localhost"
  54. MAIL_PORT = 25
  55. MAIL_USE_SSL = False
  56. MAIL_USE_TLS = False
  57. MAIL_USERNAME = "noreply@example.org"
  58. MAIL_PASSWORD = ""
  59. MAIL_DEFAULT_SENDER = ("Default Sender", "noreply@example.org")
  60. # Where to logger should send the emails to
  61. ADMINS = ["admin@example.org"]
  62. ## Flask-And-Redis
  63. REDIS_ENABLED = False
  64. REDIS_HOST = 'localhost'
  65. REDIS_PORT = 6379
  66. REDIS_DB = 0
  67. FORUM_URL_PREFIX = ""
  68. USER_URL_PREFIX = "/user"
  69. AUTH_URL_PREFIX = "/auth"
  70. ADMIN_URL_PREFIX = "/admin"